Jump to content

what is the correct syntax for this?


dwex

Recommended Posts

Is there something wrong with the codes here?  Edit button

 

<form action='edititemadmin.php' method='get'>
	<input type='hidden' id='id' name='id' value=<?php echo $row["{$tab}_id"]?>/>
	<input type='hidden' id='table' name='table' value=<?php echo $tab;?>/>
	<br>   <input type="submit" Value="Edit"/>   </br>
	</form>

$tab = $_POST['table'];

$HOST = 'localhost';
$USERNAME = 'root';
$PASSWORD = '';
$DB = 'pbstore';

$link = mysqli_connect($HOST,$USERNAME,$PASSWORD,$DB) or die(mysqli_connect_error());
$sql = "SELECT {$tab}_id , {$tab}_name , {$tab}_price , {$tab}_description , {$tab}_image , {$tab}_stock , {$tab}_time
FROM {$tab}";
$result = mysqli_query($link, $sql) or die(mysqli_error($link));

 

$tab is working as I'm able to display the things I want on the page.

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.