|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||||
|
|||||
|
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. |
|
#2
|
|||
|
|||
|
Re: MySQL Problem
I believe the function is "mysql_num_rows", not "mysql_numrows" (note the underscore between num and rows).
|
|
#3
|
|||||
|
|||||
|
Re: MySQL Problem
Try using:
PHP Code:
Also, all that mysql_result stuff is probably overkill thanks to mysql_fetch_array. PHP Code:
|
|
#4
|
|||||
|
|||||
|
Re: MySQL Problem
PHP Code:
|
|
#5
|
|||||
|
|||||
|
Re: MySQL Problem
Allright guys, thanks, I'll try these.
|
|
#6
|
|||||
|
|||||
|
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. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| MySQL on Windows | Venkatesh | IT / Communications | 6 | 27-06-2004 19:12 |
| Victor problem | Andy Baker | Electrical | 15 | 24-06-2003 09:49 |
| Ok one problem | cantwell03 | Programming | 3 | 13-02-2003 07:28 |
| The problem with scouting... | archiver | 2001 | 10 | 23-06-2002 23:49 |
| Major problem with chipphua motors | aka Scott White | Motors | 18 | 19-03-2002 19:44 |