Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Hey guys I am just starting out with PHP and MySQL. I have preious knowledge with programming and database programming so I wanted to jump right into this. I am testing this out on my computer which is a windows box running Appache (2.something the newest one) and PHP5. I also have MySQL running. I wrote some code using an Access DB and setting up an ODBC for it. Now I am trying to use MySQL and no matter what code I write I get a blank screen. I get no error messages or anything. I have some basic code that I will post in here. I'm not sure everything is set up properly because it seems to be doing absolutly nothing. Here is some basic code, and the DB is setup properly.
[syntax="php"]<?php
$mysql_link = mysql_conn1ect("localhost","root","qwerty");
mysql_select_db("han", $mysql_link);
$sql = "SELECT * FROM Products";
$result = mysql_query( $sql );
$num=mysql_numrows($result);
while ($result_row = mysql_fetch_row(($result)))
{
echo $result_row;
echo 'Title: '.$result_row[1] . '<br />';
echo 'Author: '.$result_row[4] . '<br /> ';
}
?>
Like I said nothing gets displayed on the screen. Any ideas?
arborint | Please use[/syntax]
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]