Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

using php mysql insert with bigint and smallint

Posted on 2010-08-17
4
Medium Priority
?
970 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 1000 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 1000 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
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…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

715 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