Jump to content

My SQL Insert into Sometimes working and sometimes not


durgaprasadcs

Recommended Posts

Hello ,

 

I have a Query to insert values to database. The Query is working fine sometimes and sometimes not.

 

Here is the Query I have 

 

 $sql = "INSERT INTO snicyposts (MAKE,MODEL,VARIANT,YEAR,COLOUR,FUELTYPE,MILEAGECITY,MILEAGEHIGHWAY,KILOMETERS,TITLE,DESCRIPTION,FEATUES,PRICE,NEGOTIABLE,SCRATCH,OWNERTYPE,CITY,ACCIDENT,TYPE,POSTEDBY,PHONE,POSTEDBYEMAIL,POSTEDON,POSTEDBYUSERNAME,IPADDRESS,POWERSTEERING,POWERWINDOWS,INSURANCEVALIDITY,REGISTRATIONTYPE) 
VALUES ( '$make','$model','$variant','$year','$colour','$fueltype','$citymil','$highmil','$km','$title','$desc','$features','$price','$negotiable','$scratc','$owner','$city','$accidents','$type','$name','$phone','$email','$currenttime','$usernameposted','$ipadd','$powersteering','$powerwindows','isurance','$regtype')";
mysql_query($sql);
 
Please help me to solve this 

Yes I have a column like FEATUES and I have tried echoing,the format and all perfect. Issue is if it is not working entirely I can able to find the root cause, but its sometimes working and sometimes not. That's the problem.
 

Is there any problem with my host ? even I tried with them , but they said there is no problem in their server.

two possibilities come to mind -

 

1) you have some indexes/unique keys set up and you are tying to insert duplicate values.

 

2) you are not escaping the string data being put into the query and some data contains sql special characters.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.