/    Sign up×
Community /Pin to ProfileBookmark

Syntax error

<?php
session_start();
require_once “scripts/connect_to_mysql.php”

//Build Main Navigation menu and gather page data here
$sqlCommand = “SELECT id, linklabel FROM pages WHERE showing=’1′ ORDER BY id ASC”;
$query = mysqli_query($myConnection, $sqlCommand) or die (mysqli_error($myConnection));

$menuDisplay = ”;
while ($row = mysqli_fetch_array($query)) {
$pid = $row[“id”];
$linklabel = $row[“linklabel”];

$menuDisplay .= ‘<a href=”index.php?pid=’ . $pid . ‘”>’ . $linklabel . ‘</a><br />’;

}
mysqli_free_result($query);
//mysqli_close($myConnection);
?>


——————————————————————–

this give me an error saying
syntax error, unexpected ‘$sqlCommand’

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@NogDogApr 08.2012 — You can help us to help you by (a) wrapping your PHP code in [noparse][code=php]...[/code][/noparse] tags, and (b) copy-and-pasting the exact error message text (including file and line number info it gives).

That being said, the first problem I see is no semi-colon at the end of line #3.
Copy linkTweet thisAlerts:
@OxtisauthorApr 08.2012 — thanks

that solved my question.

?
×

Success!

Help @Oxtis spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...