MySQL Forums
Forum List  »  PHP

Getting a value from a table
Posted by: Michael Smith
Date: January 08, 2020 06:56AM

I have a table whereby I can show the first row with the code below:


$sql = "SELECT delseq, serno from delseq01 order by delseq DESC limit 1 ";

$result = $conn->query($sql);

if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
echo "
<tr >
<td >" . $row['delseq']."</td>
<td >" . $row['serno']." </td>
</tr>
";

I want to extract "serno" as a value such as $val1 so I can use it in another part of the program.

I have used W3SCHOOLS and other references and I can't find an answer for this.

Options: ReplyQuote


Subject
Written By
Posted
Getting a value from a table
January 08, 2020 06:56AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.