Help, SQL query result error


<?php
ini_set('display_errors',1);
error_reporting(E_ALL);
$link = mysqli_connect('localhost', 'root', 'root');
if (isset($link))
{echo "Link successfully established";}

mysqli_select_db($link, 'Inventory')
	$result = mysqli_query($link,  'SELECT StockId , StockItem FROM StockMaster');
	
	while ($row = mysqli_fetch_array($result))
	{
		$StockItems[] = array('id' => $row['StockId'], 'name' => $row['StockItem']);
	}
?>

When I load the file, the following error is displayed:
Parse error: syntax error, unexpected T_VARIABLE in K:\UwAmp\www\Inventory\stockinwards0.php on line 9
Line 9 in the text editor is the line beginning with $result above.

Thanks in advance for the help.

Regards,
Rajendra

I think you missed the semicolon at the end of the line: mysqli_select_db($link, ‘Inventory’)

Cheers

Wing

Thanks, Wing. You were right.

Regards,
Rajendra

Sometimes SQL create problems to give result to the queries. You can recover these type of problems by reinstalling SQL again.

This wasnt actually a problem with the SQL, but the PHP. And… really it would be -very- rare that you would need to reinstall the SQL daemon, so i’m not sure what you’re referring to (or if you’re just spam).

This error is covered under the Common PHP Problems sticky at the top of the forum, btw.