I am following a online tutorial to create a mini shopping cart, all is going well but now i am getting this error:
Fatal error: Uncaught Error: Call to undefined function mysql_query()
I cannot find any information anywhere on this error. Every time i google it ,solutions for:
Fatal error: Uncaught Error: Call to undefined function mysql_connect()
appear.
PHP
$id = substr($prod_name, 14, (strlen($prod_name) - 14));
$get_query = mysql_query('SELECT Product_Id,Product_Name,Product_Price FROM Product WHERE Product_Id =' . mysql_real_escape_string((int) $id));
while ($get_row = mysql_fetch_assoc($get_query)) {
//subtotal
$sub = $get_row['Product_Price'] * $value;
echo $value . ' x ' . $get_row['Product_Name'] . ' @ ' . $get_row['Product_Price'] . ' ' . $sub . '<br/>';
}
Is using mysql_query a bad idea? Where may have i/tutorial gone wrong? any help will be extremely helpful