Simple SQL Insert Query Won't Work!!

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
Moonspell
Forum Newbie
Posts: 21
Joined: Tue May 13, 2003 4:54 pm

Simple SQL Insert Query Won't Work!!

Post 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.
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

$thirdquery = "INSERT INTO ... '$SteetNum' ... ";
<input name="StreetNum" ... >
;)
Moonspell
Forum Newbie
Posts: 21
Joined: Tue May 13, 2003 4:54 pm

Post 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.
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post 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
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

definitly, don't worry. It happens to all of us

Code: Select all

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