Jump to content

check my php mysql syntax please


Looktrne

Recommended Posts

can you tell me if there is something wrong with this syntax? I keep getting errors with the syntax

 

$sql = "UPDATE Profiles SET
City = 			'$row[city]',
Headline =		'$row[name]',
LookingFor = '$lf',
DescriptionMe = '$desc',
DateOfBirth 	 ='$bd',
Zip=			'$row[zipcode]' WHERE ID='$row[member_id]'";		

 

thanks for any help with this

 

Paul

Link to comment
https://forums.phpfreaks.com/topic/91635-check-my-php-mysql-syntax-please/
Share on other sites

Do this and copy and paste what you see:

 

<?php

$sql = "UPDATE Profiles SET
City = 			'$row[city]',
Headline =		'$row[name]',
LookingFor = '$lf',
DescriptionMe = '$desc',
DateOfBirth 	 ='$bd',
Zip=			'$row[zipcode]' WHERE ID='$row[member_id]'";

$result = mysql_query($sql)or die(mysql_error() . "<p>With Query:<br>$query");

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 '7" with straight long hair. I like fashion, so my clothing style is a combinati' at line 5

 

With Query:

 

 

 

 

looks the same....I am worried the variable I am uploading does not take... because I am not using stripslashes or whatever...

 

can you tell me how to clean a variable for mysql

 

Paul

Thats strange, after the "With Query:" part it was supposed to show your query, and it came out blank...unless you left that part out.

 

to clean a variable for database insertion you want to use mysql_real_escape_string() on it. It will probably solve your problem if you do that to all the variables.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.