Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Hello everyone, I am a beginner , I need help with this simple php code. I am trying to retrieve some data from a MySQL database, and I keep getting the same error.
The error message that I get is:Code: Select all
Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING in /homepages/34/d155877179/htdocs/lunchantojitosframe.php on line 22I am probably overlooking something really simple, but heres the code:
any help would be greatly appreciated, thanks in advance!
Code: Select all
<?php
@ $db = new mysqli('db341.perfora.net ', 'dbo376145627', 'Bg876cc2' 'db160310543');
if(mysqli_connect)errno())
{
echo 'Error: Could not connect to database. Please try again later.';
exit;
}
$query = "select * from lunchmenu";
$result = $db->query($query);
$num_results = $result->num_rows;
for ($i=0; $i <$num_results; $i++)
{
$row = $result->fetch_assoc();
echo '<p><strong>'($row['item'])'</strong>';
echo '<br /><center>'($row['description']);
echo '<br /><center>'($row['price']);
echo '</p>';
}
$result->free();
$db->close();
?>feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]