![]() |
MySQL Problem
I am trying to learn working with MySQL databases through PHP but I'm having some problems. I've written this simple scipt which takes a table named "contacts" and first enters some information into the table. Then, it attempts to read and display the data in the table.
Here's the full code: PHP Code:
PHP Code:
PHP Code:
PHP Code:
Oh, and there is a primary key in the first part of the table named "id" which is not displayed to the user, and its set to Auto_incriment so the data doesn't have to be entered for it. |
Re: MySQL Problem
I believe the function is "mysql_num_rows", not "mysql_numrows" (note the underscore between num and rows).
|
Re: MySQL Problem
Try using:
PHP Code:
Also, all that mysql_result stuff is probably overkill thanks to mysql_fetch_array. PHP Code:
|
Re: MySQL Problem
PHP Code:
|
Re: MySQL Problem
Allright guys, thanks, I'll try these.
|
Re: MySQL Problem
OK, I found the problem, but I didn't get a good error report until evulish suggested that line with the "or die()". The real problem was that my table was not named "contacts", it was contact. lol
Thanks alot guys. |
| All times are GMT -5. The time now is 15:31. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi