MySQL Forums
Forum List  »  PHP

Nevermind, Problem Resolved
Posted by: Bryan
Date: February 02, 2006 07:20PM

I stumbled accross the solution. I've been working with PHP / MySQL for several years now and never realized until just now that I was using an unnecessary step in my INSERT INTO queries.

I was doing this...
$query = "INSERT INTO tb_payments " .
"(payment_key, client, date, amount, method, check, invoice1, amt1, invoice2, amt2, invoice3, amt3, invoice4, amt4, invoice5, amt5) VALUES " .
"('', '$client', '$date', '$amount', '$method', '$check', '$invoice1', '$amt1', '$invoice2', '$amt2', '$invoice3', '$amt3', '$invoice4', '$amt4', '$invoice5', '$amt5')";

When all I needed was this...
$query = "INSERT INTO tb_payments VALUES " .
"('', '$client', '$date', '$amount', '$method', '$check', '$invoice1', '$amt1', '$invoice2', '$amt2', '$invoice3', '$amt3', '$invoice4', '$amt4', '$invoice5', '$amt5')";

So...maybe I should've posted this in the Newbie thread <blush>. Anyway, hope this helps someone.

Options: ReplyQuote


Subject
Written By
Posted
February 02, 2006 12:26PM
Nevermind, Problem Resolved
February 02, 2006 07:20PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.