borneo
borneo

Reputation: 97

How do i take a specific last value from MySQL

So, I query a database and I succeed with this query:

$sql = 'SELECT * FROM log WHERE dokumen_name LIKE "%A12345%" ORDER BY Id DESC LIMIT 1';

and the result is this: value

Then I want to take from the red box to put it in here:

<h3>di Posisi sekarang: <?php echo $row["lokasi"];  ?></h3>

but it did not show up, how do I do that?

Upvotes: 0

Views: 49

Answers (2)

borneo
borneo

Reputation: 97

My code is right, turn out i query after <h3>di Posisi sekarang: <?php echo $row["lokasi"]; ?></h3> this code, so it will not work. so, i put the query before the di Posisi sekarang: <?php echo $row["lokasi"]; ?></h3> and it works. soory for my misconception.

Upvotes: 0

Ende
Ende

Reputation: 311

<h3>di Posisi sekarang: <?php echo $row["Lokasi"];  ?></h3>

Don't forget capitals

Upvotes: 2

Related Questions