Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

The Database Forum


You are currently viewing our The Database Forum as a guest. Please register to participate.
Login



Reply
why is this query failing?
Old 09-14-2006, 01:10 AM why is this query failing?
Experienced Talker

Posts: 33
Trades: 0
Greetings,

Can someone please tell me why the following query is failing?

Code:
        $qryupdate = "INSERT INTO Warranty (servicetag, description, provider, startdate, enddate, daysleft) " .
                "VALUES ('$servicetag', '$description', '$provider', '$startdate', '$enddate', '$daysleft') " .
                "WHERE (servicetag='$servicetag', description='$description', provider='$provider', " .
                "startdate='$startdate', enddate='$enddate')";

        $results = mysql_query($qryupdate);
Thanks,

*Nick*
nick1 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 09-14-2006, 02:02 AM Re: why is this query failing?
Extreme Talker

Posts: 246
Trades: 3
A regular INSERT query like this will fail if you add the WHERE clause. You will want to set the variables $servicetag, $description, etc before you build the query string. Also, I don't know what the type is for the field $daysleft, but if it is an INT then you do not want to put the single quotes around $daysleft.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
CouponGuy is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to why is this query failing?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.21494 seconds with 12 queries