Welcome! Log In Create A New Profile

Advanced

Team Selection page SQL update error

Posted by 37081888 
Announcements Last Post
Announcement SoC Curricula 09/30/2017 01:08PM
Announcement Demarcation or scoping of examinations and assessment 02/13/2017 07:59AM
Announcement School of Computing Short Learning Programmes 11/24/2014 08:37AM
Announcement Unisa contact information 07/28/2011 01:28PM
avatar Team Selection page SQL update error
May 15, 2013 05:18PM
I'm quite sure the syntax for update is correct like on my edit.php page however, when I try to update the selections table for a selected fixture from a drop down list form, it throws out this error:

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 '1='', defender 2='', defender 3='', defender 4='', midfielder 1='', mid' at line 1

I hope that's not too vague but, it's the only complaint the server has and I've tried multiple things to sort it out like, changing the inverted commas, using an insert statement instead, etc. to no avail. Same error pops up only after I select players for a certain fixture and click the UPDATE button at the bottom of the form...

MySQL version 5.5.

Anyone else have/had an issue with an UPDATE function and knows how to sort it out?
avatar
Mac
Re: Team Selection page SQL update error
May 15, 2013 06:04PM
The error means there is a typo somewhere. looking at it you should not have have a space in a column name. Else use a backtick as in `defender 3`
avatar Re: Team Selection page SQL update error
May 16, 2013 06:10PM
Ok I see. I'll try your suggestions out and report back here. Thanks.
avatar Re: Team Selection page SQL update error
May 16, 2013 07:08PM
MAc, I've got it working now. I tried your methods but, they didn't work so, I simply removed the spaces in the DB selections table itself and changed the coding accordingly. Works great now!
Re: Team Selection page SQL update error
May 24, 2013 10:44AM
can anyone help me fix this code, i have an error which says "query was empty" when I update the selection_team table

$sql = mysql_query("UPDATE team SET GoalKeeper='$_POST[Goal_keeper]',Fullback='$_POST[Full_Back]',
wing='$_POST[Wing]', middlefield='$_POST[Middle_Field]', striker='$_POST[Striker]'
AND fixture_id=$_POST[fixture_id] WHERE selection_id=$_POST[selection_id] "winking smiley;
mysql_query($sql) or die('not successfully'.mysql_error());
avatar Re: Team Selection page SQL update error
May 24, 2013 07:30PM
Please format your code.
Remove the mysql_query( from the first line:

$sql = "UPDATE team SET and so forth
Re: Team Selection page SQL update error
May 25, 2013 01:14PM
Yoh...

Hi. Mac

Im having a problem with connecting my database, I registered on 000webhost.com, then I uploaded all my files on file manager in public folder, and also create a database. then i amend the connection part using the name of the database, username, password and host name the way it has been named. then I get an error which says:

Warning: mysql_connect() [function.mysql-connect]: Host '31.170.160.75' is not allowed to connect to this MySQL server in /home/a4546305/public_html/connect.php on line 7

Free Web Hosting
Host '31.170.160.75' is not allowed to connect to this MySQL server

Please help fix the error
avatar
Mac
Re: Team Selection page SQL update error
May 27, 2013 08:57AM
What does this have to do with this topic??

I cannot help with such errors as I do not know what you have done/not done. Maybe it was just down for a while. No one else had this problem....?
Sorry, only registered users may post in this forum.

Click here to login