HELP

Discuss how to write good code, break bad code, your current pet projects, or the best way to approach novel problems

HELP

Post by PC_MAGAS on Sun May 25, 2008 1:38 pm
([msg=3201]see HELP[/msg])

i've made this script:
html><body>
<? php
$connection=mysql_connect(localhost,root,malakas);
mysql_select_db(cdcol,$connection);
$guery= "SELECT titel,interpret,jahr FROM cdS WHERE jahr<2000 ORDER BY jahr";
$result=mysql_query($guery,$connection);
$numres=mysql_num_rows($result);
for($a=0;$a<$numres;$a=$a+1)
{
$title=mysql_result($result,$a,0);
$artist=mysql_result($result,$a,1);
$year=mysql_result($result,$a,2);
echo $a+1."<b>". $title. "by" .$artist. "in".$year."br";
}
?>
</html></body>
AND I TOOK THIS ERROR:
Parse error: syntax error, unexpected T_VARIABLE in C:\xampp\htdocs\hacker\second.php on line 3
PC_MAGAS IS O VASILEUS OF COMPUTERS
BUT FOR WOMEN I'M THE FAIRYTALE'S PRINCE
User avatar
PC_MAGAS
New User
New User
 
Posts: 48
Joined: Sat May 03, 2008 11:20 am
Location: Greece Aharnes Attiki
Blog: View Blog (0)


Re: HELP

Post by Rijnzael on Sun May 25, 2008 6:16 pm
([msg=3221]see Re: HELP[/msg])

try putting all your non-constant, non-variable strings in quotes. You're passing things to functions which don't appear to be defined as constants and aren't prefixed with $'s, so they're not variables. This means you need to delimit them as string values by putting them in matching single or double quotes.
Rijnzael
Poster
Poster
 
Posts: 164
Joined: Sun Apr 13, 2008 10:12 am
Location: 128.0.0.0/8
Blog: View Blog (0)


Re: HELP

Post by PC_MAGAS on Wed May 28, 2008 1:33 pm
([msg=3422]see Re: HELP[/msg])

Thanks. Also I wanna ask u sth do u know how can I set url in XAMMP
Last edited by PC_MAGAS on Sun Jul 20, 2008 11:45 am, edited 1 time in total.
PC_MAGAS IS O VASILEUS OF COMPUTERS
BUT FOR WOMEN I'M THE FAIRYTALE'S PRINCE
User avatar
PC_MAGAS
New User
New User
 
Posts: 48
Joined: Sat May 03, 2008 11:20 am
Location: Greece Aharnes Attiki
Blog: View Blog (0)


Re: HELP

Post by Rijnzael on Wed May 28, 2008 5:09 pm
([msg=3435]see Re: HELP[/msg])

I have no idea what you just typed. Try using full words, sentences, and punctuation.
Rijnzael
Poster
Poster
 
Posts: 164
Joined: Sun Apr 13, 2008 10:12 am
Location: 128.0.0.0/8
Blog: View Blog (0)



Return to Programming

Who is online

Users browsing this forum: No registered users and 0 guests