This is a discussion on "Database Update script problems" within the PHP Forum section. This forum, and the thread "Database Update script problems are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
Database Update script problems
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
#1
|
|||
|
|||
|
Database Update script problems
Hi there again,
ok i am having a problem with my update script, it is meant to update a record after first you enter the record you are looking for it pulls it up on php which then display it in form so that it can tehn be sent via get to the script tha tupdates it. i rather suspect its my sql command that wrong here is the 3 piece of script Quote:
Quote:
Quote:
thanks |
|
|
|
#2
|
|||
|
|||
|
Re: Database Update script problems
Method is post but you're using Get. Use $_POST to get user's input.
Is the password really "no"? echo $query to the browser, then paste it in the sql tool on phpmyadmin, it might give a syntax error that'd be a pain to parse by eye. |
|
#3
|
|||
|
|||
|
Re: Database Update script problems
ignore this... i should really actually read code before making comments :P
Last edited by Accurax; May 13th, 2007 at 11:24. |
|
#4
|
|||
|
|||
|
Re: Database Update script problems
Quote:
the password is only set to no on the localhost on my machine the live version would not be set to no |
|
#5
|
|||
|
|||
|
Re: Database Update script problems
Quote:
|
|
#6
|
|||
|
|||
|
Re: Database Update script problems
this is the sql error i am getting
ERROR: Unclosed quote @ 121STR: 'SQL: UPDATE 'student' SET studentname = 'test', class = 'test', math = '30', english = '40', socsci = '50', WHERE studentid = '1000SQL-query : UPDATE 'student' SET studentname = 'test', class = 'test', math = '30', english = '40', socsci = '50', WHERE studentid = '1000 MySQL said: #1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ''student' SET studentname = 'test', class = 'test', math = '30' |
|
#7
|
|||
|
|||
|
Re: Database Update script problems
put a closing tick after '1000
|
|
#8
|
|||
|
|||
|
Re: Database Update script problems
ignore this... not reading properly
|
|
#9
|
|||
|
|||
|
Re: Database Update script problems
all it says now is
WHERE studentid = '1000 ' that where there error is although i am stumped because the query seems fine to me and when i do it via myphpadmin for updating its the exact same query so i dnt understadn why it wont work i guess i am missing something trival |
|
#10
|
|||
|
|||
|
Re: Database Update script problems
post the entire query as printed out through an echo statement after building it in PHP?
|
|
#11
|
||||
|
||||
|
Re: Database Update script problems
Quote:
Quote:
Quote:
Quote:
UPDATE student SET name = 'test', class = 'test', math = '30', english = '40', socsci = '50', WHERE id = '1000' here is what db admin says when i use the command Error SQL-query : UPDATE student SET name = 'test', class = 'test', math = '30', english = '40', socsci = '50', WHERE id = '1000' MySQL said: #1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE id = '1000'' at line 6 |
![]() |
| Tags |
| database mysql update |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [SOLVED] Use info from Database in a script ??? | WebNinja | PHP Forum | 2 | May 3rd, 2008 00:59 |
| More script problems yet again | a.jenery | Classic ASP | 12 | May 9th, 2006 09:24 |
| problems connecting to database | benbacardi | Classic ASP | 8 | Apr 15th, 2005 16:16 |
| still having problems writing to database... | benbacardi | Classic ASP | 9 | Aug 26th, 2004 16:20 |
| Update autonumber field in Access Database | redkyna | Databases | 3 | Aug 20th, 2004 09:18 |