Solved

using php mysql insert with bigint and smallint

Posted on 2010-08-17
4
918 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL several years ago, it seemed like now was a good time to update it for object-oriented PHP.  This article does that, replacing as much as possible the pr…
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 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…

739 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