I get the echo “error” else statement, meaning the query didn’t run. What’s up? I’ve checked spelling for the fields in the database. I’ve made sure all variables are set correctly.
$queryc = "UPDATE members SET pubemail='$pe',
company='$co', usertitle='$ut', address1='$a1',
address2='$a2', city='$ci', state='$st', zip='$zi'
WHERE id=$id";
the code [COLOR=red]WHERE id=$id[/COLOR]
[COLOR=black]make that [/COLOR][COLOR=blue]WHERE id=’$id’[/COLOR]
[COLOR=#0000ff]
$queryc = "UPDATE members SET pubemail='$pe',
company='$co', usertitle='$ut', address1='$a1',
address2='$a2', city='$ci', state='$st', zip='$zi'
WHERE id='$id'";
Actually if “id” is an integer (or numerical value), like I’m guessing it is, then it shouldn’t have the quotes around it.
I’ve had issues like this before where I’ve checked everything and still get an error. The solution’s been different most times – mainly because I messed something up.
It’s hard to know what your DB set looks like. By just looking at the code, I need to ask. For the zip code (zip in the DB), is that an integer or are you allowing for non-numeric characters? If the zip is set up as an integer (or numerical value) then you wouldn’t need the quotes around the $zi.
If that doesn’t work, it would be helpful to see how you have your database set up.
usertitle=‘$ut’ … I don’t see a “usertitle” in your database. There’s the problem: usertitle should be username
I setup a database and ran a test, orginally it failed to make the updates. I then changed usertitle=‘$ut’ to be username=‘$ut’ for your query and then it worked fine.