Solved

using php mysql insert with bigint and smallint

Posted on 2010-08-17
4
907 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

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Split wordpress loop 35 56
Inserting data into database 10 34
Wordpress Pagination 1 28
Log in through ID 5 17
Creating and Managing Databases with phpMyAdmin in cPanel.
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

809 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