Solved

using php mysql insert with bigint and smallint

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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Generating table dynamically is the most common issue faced by php developers.... So it seems there is a need of an article that explains the basic concept of generating tables dynamically. It just requires a basic knowledge of html and little maths…
Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

758 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now