-2

Trying to put only the value of column id from table existence:

$sql_query_existence = "SELECT * FROM existence ORDER BY id DESC LIMIT 1";
$sql_test = $sql_query_existence['id'];

The second line is my idea, how do I do this right? Any suggestion is appreciated.

David Walschots
  • 12,279
  • 5
  • 36
  • 59
KiritoLyn
  • 626
  • 1
  • 10
  • 26

1 Answers1

0

So you want to get the value of the id column? If so, use this query

SELECT id FROM existence ORDER BY id DESC LIMIT 1;

and if you want to set the value of the id column only, use either

INSERT INTO existence(id) VALUES (<Your ID>);

or

UPDATE existence SET id=<Your ID> WHERE ...;

This answer is SQL based since I don't know php, but this answer will help you do the necessary php work involved.

Thomas Flinkow
  • 4,845
  • 5
  • 29
  • 65