Jump to content

Recommended Posts

I need to get the max of the field called ID, from the table ordenador. This is my actual code:

$cons = "SELECT MAX(ID) FROM `ordenador`";
$maxrow = consultar_bd($cons);
$id_contiene = $maxrow['ID'];

 

consultar_bd is a function that executes a sql query and returns a fetched result as a array.

Link to comment
https://forums.phpfreaks.com/topic/238477-geting-max-of-a-mysql-field/
Share on other sites

Sorry maybe its that my english is bad, but i think i asked it:

 

What  i need is to get the max of the ID value in the ordenador table using php + mysql.  Thats the code i was using but it dont works, when i try to get the ID it says that index dont exist.

 

I need some way to know and store in a php variable what is the higest ID value.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.