Unexpected T_Variable ?


Posted on 16th Feb 2014 07:03 pm by admin

Hi all,
I dont really know what I am doing!! I know I'm doing something wrong, and I know its on line 42 "$sql="select pname, award, aw_year" but I dont know why its a problem?? Can anyone help me understand what I am doing wrong please??

Full code below:
Did you know?Explore Trending and Topic pages for more stories like this.

Code: <?php

$conn = mysql_connect("CNX INFO") or trigger_error("SQL", E_USER_ERROR);
$db = mysql_select_db('bssql',$conn) or trigger_error("SQL", E_USER_ERROR);

$sql="SELECT pname FROM pname ORDER BY pname";
$result=mysql_query($sql);

$options="";

while ($row=mysql_fetch_array($result)) {

$id=$row["pname"];
$thing=$row["pname"];
$options.="<OPTION VALUE="$id">".$thing.'</option>';
}


?>


<html>
<body>

<FORM action="<?php echo $_SERVER['PHP_SELF']; ?>" method="get">
<SELECT NAME=pname>
<OPTION VALUE=0>Choose
<?=$options?>
</SELECT>
<input type="submit" name="submit" value="submit">
</FORM>

<?php

if(isset($_GET['submit'])){
print stripslashes($_GET['pname']); //this is where i need to get the rest of the information to display//

//

}
$pname=$_GET['pname']
$sql="select pname, award, aw_year
FROM pname, aw_result, award
WHERE pname.name_id=aw_result.pname_id
AND award.award_id=aw_result.award_id
AND pname='$pname'
ORDER BY aw_year";
$info=mysql_query($sql1);

echo $info?>



</body>
</html>
No comments posted yet

Your Answer:

Login to answer
260 Like 12 Dislike
Previous forums Next forums
Other forums

Checking BOM Authorization Group
Hai Friends,

I have developed a mulitilevel BOM display report. End users have been assig

duplicate record notification
In my database, after insertion of records, I want to know if the record inserted is duplicate or no

Need some ideas as to how to go about sorting this array...
Here's how the array's are created..

Code: <?php
while ($x = readdir($dp)) {

Hyperlink is adding an extra gap to variable
Hi, here's my problem..

I have a php generated page with a hyperlink which opens in a new win

PHP FTP Can't upload Big FIles
Anyone had any success using FTP to upload a file say 90m?

im using ftp_put and it returns fa

SAP Project Module
I have seen in the SAP Project Module,plan cost and budget are not equal and even difference is sign

ME54/ME54N Conditional check for Release of PR
Hi Gurus,

My requirement is to put a check on the release of the PR with respect to the c

How to calculate days from variable date?
This will be easy for one of you gurus. I want to fetch the date from a variable date, for example:<

php forms and database navigatio
Hello,
I'm new to php and i'd like to post the following.
I have written code to get records f

Async WSAConnect failed on XP with error code = 2 ("File not found")
Hi all,

I have very strange bug, please help me if you can.

It is reproduced o

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash