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
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");

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.