Jump to content

Store and update only one record in MySQL table


PeterPopper

Recommended Posts

I have a database with one table and one row, the row is listNumber.

 

I want to update and retrieve the value of listNumber but maintain just one row in the table. The problem is that if I use INSET, it works fine, but UPDATE, as in my code below, is not working. I don't want to use INSERT because it creates a new record each time.

 

Update:

$sql="UPDATE MainTable SET listNumber='$theNewCount'";

 

Retrieve:

$sql="Select listNumber FROM MainTable;

 

Thanks.

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.