|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Problem with Tutorial >> Create dynamic sites with PHP & MySQL by Md. Ashraful Anam
I am using the code from this page:
http://codewalkers.com/tutorials/9/8/ I get the following error when I run it in my browser: Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/moontots/public_html/test/viewdb.php on line 8 Here is the code: >> <HTML> >> <?php >> $db = mysql_connect("localhost", "root", ""); >> mysql_select_db("learndb",$db); >> $result = mysql_query("SELECT * FROM personnel",$db); >> echo "<TABLE>"; >> echo"<TR><TD><B>Full Name</B><TD><B>Nick Name</B><TD><B>Salary</B></TR>"; >> while($myrow = mysql_fetch_array($result)) >> { >> echo "<TR><TD>"; >> echo $myrow["firstname"]; >> echo " "; >> echo $myrow["lastname"]; >> echo "<TD>"; >> echo $myrow["nick"]; >> echo "<TD>"; >> echo $myrow["salary"]; >> } >> echo "</TABLE>"; >> ?> >> </HTML> |
|
#2
|
|||
|
|||
|
RE: Problem with Tutorial >> Create dynamic sites with PHP & MySQL by Md. Ashraful Anam
do you have anything stored in the database?
|
|
#3
|
|||
|
|||
|
RE: Problem with Tutorial >> Create dynamic sites with PHP & MySQL by Md. Ashraful Anam
Yes I do.
|
|
#4
|
|||||
|
|||||
|
RE: Problem with Tutorial >> Create dynamic sites with PHP & MySQL by Md. Ashraful Anam
I can view it in a browser using this code:
php Code:
|
|
#5
|
|||
|
|||
|
RE: Problem with Tutorial >> Create dynamic sites with PHP & MySQL by Md. Ashraful Anam
Sorry about the multible posts, I was "Anonymous" now I have loggined in.
|
|
#6
|
|||
|
|||
|
RE: Problem with Tutorial >> Create dynamic sites with PHP & MySQL by Md. Ashraful Anam
well you've got two different queries there, which one are you using?
SELECT * FROM personnel or SELECT * FROM testDB |
|
#7
|
|||
|
|||
|
RE: Problem with Tutorial >> Create dynamic sites with PHP & MySQL by Md. Ashraful Anam
Actually, I figured the problem out.
The Table name (testDB) is case sensetive. In the code I was using, I was using testdb, not testDB (The personnel table is from Mr. Anam's tutorial code). I became case sensetive myself, made the change, and it worked fine. Thanks for spending thought power on me. |
![]() |
| Viewing: Codewalkers Forums > Other > Tutorials > Problem with Tutorial >> Create dynamic sites with PHP & MySQL by Md. Ashraful Anam |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|
|