Solved

using php mysql insert with bigint and smallint

Posted on 2010-08-17
4
912 Views
Last Modified: 2012-08-14
Hello,

How should I use the php mysql_query function to insert data into a mysql table that has columns of bigint and smallint data types?
0
Comment
Question by:cgray1223
  • 2
4 Comments
 
LVL 11

Accepted Solution

by:
Rajesh Dalmia earned 250 total points
ID: 33461471
in php data insert you don't have to typecast values. Just don't put single quotes (') around the passing value. mysql_query function will auto takecare of data types.
0
 
LVL 9

Assisted Solution

by:Snarfles
Snarfles earned 250 total points
ID: 33461489
mysql_query("INSERT INTO table (bigint, smallint)
VALUES ( 189292 ,1 )");
0
 

Author Comment

by:cgray1223
ID: 33461712
My problem was that I was using a column named ORDER and the php mysql_query failed to insert until I renamed it.
0
 
LVL 11

Expert Comment

by:Rajesh Dalmia
ID: 33461718
during insert try field name as [ORDER]
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
When table data gets too large to manage or queries take too long to execute the solution is often to buy bigger hardware or assign more CPUs and memory resources to the machine to solve the problem. However, the best, cheapest and most effective so…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

740 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question