Jump to content

Select returns IDs up to 127


Manixat

Recommended Posts

Hello freaks,

 

I have an insert query that uses a select query to find values to insert. To make it more clear I have around 4000 cities stored in a database and when a user registers the name of the city is sent to PHP but I need to record the ID and then my query looks something like this

 

 

 

INSERT INTO `users` (`blablabla`,`blablabla`,`CITY`) VALUES (`blablabla`,`blablabla`,(SELECT `ID` FROM `cities` WHERE `Name`='$phpvariable'))
 

The problem is that it retrieves cities up to ID 127. I suppose that is due to the data limit of TINYINT. My question is how do I get around that, or in other words how can I change the data type the SELECT query returns ?

Link to comment
https://forums.phpfreaks.com/topic/276401-select-returns-ids-up-to-127/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.