SQL Query

DescriptionPHP snippet by - 03/01/10

This PHP snippet makes a connection to your MySQL database. You can change the query to whatever you want.

Tags , ,

<?php

$dbc = mysqli_connect('localhost','the_database_user','the_database_password','the_database_name') or die('Error connecting to Database');

$query = "SELECT *
FROM table_name
WHERE id = 1
LIMIT 0 , 30";

$result = mysqli_query($dbc, $query);

$row = mysqli_fetch_array($result);

echo $row[0];

//Close the Connection
mysqli_close($dbc);

?>
  • Share
Authored by: Adam J Nowak
http://hyperspatial.com

Comments and Feedback