Page 1 of 1

Simple SQL Insert Query Won't Work!!

Posted: Tue May 13, 2003 4:54 pm
by Moonspell
This won't put data in the StreetNum field. Every field has the data properly inserted excepted this field, and it's really boggling me.

$thirdquery = "INSERT INTO CustomerEntry (ClientSalesID, ClientNameID, FName, LName, StreetNum , StreetName, Zip, Telephone, Email, GuessNumber, GuessDate, CurrVehicleYr, CurrVehicleMake, CurrVehicleModel, LastVehiclePurchase, VehicleType, CurrPayement, MostImportantNewCar, Marketing) values ('$findtheidresult','$theclientid','$FName','$LName','$SteetNum','$StreetName','$Zip','$Telephone','$Email','$GuessNumber','$GuessDate','$CurrVehicleYr','$CurrVehicleMake','$CurrVehicleModel','$LastStringTotal','$VehicleType','$CurrPayment','$MostImportantNewCar','$Marketing') ";
mysql_query($thirdquery);

So since there was only one that didn't enter correctly, I thought maybe the variable '$StreetNum' was incorrect. Here's the input field:

<td> <input name="StreetNum" type="text" id="StreetNum" size="10" maxlength="10">

I'm not sure what's going on?? It is left blank, or NULL no matter what you enter in it.

Posted: Tue May 13, 2003 6:23 pm
by volka
$thirdquery = "INSERT INTO ... '$SteetNum' ... ";
<input name="StreetNum" ... >
;)

Posted: Tue May 13, 2003 6:57 pm
by Moonspell
There's been something wrong with me lately. I looked at it atleast 25 times, seriously. Sorry for wasting your time. I'm sure a lot of people require someone else's time for such a careless mistake. My bad. Thank you though.

Posted: Wed May 14, 2003 2:45 am
by twigletmac
Don't worry - sometimes it just needs another pair of eyes looking at it since obvious mistakes can become invisible if you've been staring at something for ages.

Mac

Posted: Wed May 14, 2003 3:01 am
by volka
definitly, don't worry. It happens to all of us

Code: Select all

if ($num = 0) { ... }
I hate this...