[SOLVED] no result connecting to mysql
Posted: Tue Oct 18, 2005 10:45 am
hey guys
im new to php, been using java (jsp's) and mysql for awhile
im running windows 2000
set up php5, mysql4.1, apache2
all set up and working together so it seems
trying to connect to mysql with php but i get no results or anything after my first line of code (the connect statement)
i done a quick search and didnt find to much on this topic,
heres my code
ive put some echo "test"; in to see if its getting past certain blocks of code and i get no return after the $connect = mysql_connect statment
any help
cheers
Neill
im new to php, been using java (jsp's) and mysql for awhile
im running windows 2000
set up php5, mysql4.1, apache2
all set up and working together so it seems
trying to connect to mysql with php but i get no results or anything after my first line of code (the connect statement)
i done a quick search and didnt find to much on this topic,
heres my code
Code: Select all
$connect = mysql_connect("localhost", "*****", "******")
or die('could not connect to database; ' . mysql_error());
mysql_select_db("channel7", $connect);
$query = "Select name, position from satellites";
$results = mysql_query($query)
or die('could not connect to database; ' . mysql_error());
while ($row = mysql_fetch_array($results)) {
extract($row);
echo $name;
echo "<br>1";
echo $position;
}any help
cheers
Neill