Advertisement

There's no such thing as a stupid question, but they're the easiest to answer.
Login
Search

Advertisement

Web Design & Development Web Design & Development
Search Search
Search for:
Tech Support Guy > > >

Mysql SET syntax problem...


(!)

JiminSA's Avatar
JiminSA   (Jim) JiminSA is offline JiminSA has a Profile Picture
Computer Specs
Member with 1,584 posts.
THREAD STARTER
 
Join Date: Dec 2011
Location: Johannesburg South Africa
Experience: Intermediate
22-Jul-2012, 04:23 AM #1
Mysql SET syntax problem...
I've been staring at these 2 lines of code for hours...
PHP Code:
        mysql_query("UPDATE vehicle    SET datetime=' . $row['datetime'] . ', fullname=' . $row['fullname'] . ', email=' . $row['email'] . ', phone=' . $row['phone'] . ', cell=' . $row['cell'] . ', suburb=' . $row['suburb'] . ', make=' . $row['make'] . ', model=' . $row['model'] . ', year=' . $row['year'] . ', kms=' . $row['kms'] . ', colour=' . $row['colour'] . ', extras=' . $row['extras'] . ', servhist=' . $row['servhist'] . ', accidents=' . $row['accidents'] . ', settlement=' . $row['settlement'] . ', finhouse=' . $row['finhouse'] . ', monthsrem=' . $row['monthsrem'] . ', monthsarr=' . $row['monthsarr'] . ', amtrem=' . $row['amtrem'] . ', price=' . $row['price'] . ', comments=' . $row['comments'] . ', photos=' . $row['photos'] . ', nextpid=' . $row['nextpid'] . ', tprice=' . $row['tprice'] . ', rprice=' . $row['rprice'] . ', natis=' . $row['natis'] . ', pics4=' . $row['pics4'] . ', wcdisc=' . $row['wcdisc'] . ', aprice=' . $row['aprice'] . ', status=' . $row['status'] . ', notes=' . $row['notes'] . ' WHERE id=' . $id'")
        or die(
mysql_error()); 
and cannot see how I am getting
Quote:
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in C:\xampp\htdocs\S4W\public_html\CMS\base.php on line 139
Can someone either shoot me or show me where I'm wrong, please?
allnodcoms's Avatar
allnodcoms   (Danny) allnodcoms is offline allnodcoms has a Profile Picture
Computer Specs
Member with 610 posts.
 
Join Date: Jun 2007
Location: Hertfordshire - England
Experience: Advanced
22-Jul-2012, 05:08 AM #2
Get rid of the '.' (dot) operator and the single quotes in the array references...
Code:
SET datetime='$row[datetime]',...
That should do it!

Danny
JiminSA's Avatar
JiminSA   (Jim) JiminSA is offline JiminSA has a Profile Picture
Computer Specs
Member with 1,584 posts.
THREAD STARTER
 
Join Date: Dec 2011
Location: Johannesburg South Africa
Experience: Intermediate
22-Jul-2012, 05:22 AM #3
The syntax supremo strikes again and saved a bullet! Thanks Danny!
JiminSA's Avatar
JiminSA   (Jim) JiminSA is offline JiminSA has a Profile Picture
Computer Specs
Member with 1,584 posts.
THREAD STARTER
 
Join Date: Dec 2011
Location: Johannesburg South Africa
Experience: Intermediate
22-Jul-2012, 05:27 AM #4
and this bugger?
PHP Code:
        $result mysql_query = ("SELECT * FROM vehicle WHERE id=$vehicleid"); 
allnodcoms's Avatar
allnodcoms   (Danny) allnodcoms is offline allnodcoms has a Profile Picture
Computer Specs
Member with 610 posts.
 
Join Date: Jun 2007
Location: Hertfordshire - England
Experience: Advanced
22-Jul-2012, 05:28 AM #5
No worries Jimbo!

Danny
JiminSA's Avatar
JiminSA   (Jim) JiminSA is offline JiminSA has a Profile Picture
Computer Specs
Member with 1,584 posts.
THREAD STARTER
 
Join Date: Dec 2011
Location: Johannesburg South Africa
Experience: Intermediate
22-Jul-2012, 05:56 AM #6
I did actually get a warning on this one, which kinda threw me...
Quote:
Parse error: syntax error, unexpected '=' in C:\xampp\htdocs\S4W\public_html\CMS\base.php on line 166
and I've tried it like this
PHP Code:
$result mysql_query = ("SELECT * FROM vehicle WHERE id='$vehicleid'"); 
with the same result

Last edited by JiminSA; 22-Jul-2012 at 06:20 AM..
allnodcoms's Avatar
allnodcoms   (Danny) allnodcoms is offline allnodcoms has a Profile Picture
Computer Specs
Member with 610 posts.
 
Join Date: Jun 2007
Location: Hertfordshire - England
Experience: Advanced
22-Jul-2012, 06:22 AM #7
What's that random "=" sign after mysql_query?

Danny
JiminSA's Avatar
JiminSA   (Jim) JiminSA is offline JiminSA has a Profile Picture
Computer Specs
Member with 1,584 posts.
THREAD STARTER
 
Join Date: Dec 2011
Location: Johannesburg South Africa
Experience: Intermediate
22-Jul-2012, 06:25 AM #8
Sorry - having a "Blonde Day"!
allnodcoms's Avatar
allnodcoms   (Danny) allnodcoms is offline allnodcoms has a Profile Picture
Computer Specs
Member with 610 posts.
 
Join Date: Jun 2007
Location: Hertfordshire - England
Experience: Advanced
22-Jul-2012, 06:30 AM #9
You have hair?

Danny
As Seen On

BBC, Reader's Digest, PC Magazine, Today Show, Money Magazine
WELCOME TO TECH SUPPORT GUY!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.


(clock)
THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Search Tech Support Guy

Find the solution to your
computer problem!




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


WELCOME
You Are Using: Server ID
Trusted Website Back to the Top ↑