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:

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

How to ask a regex question?
Hi, I thought I'd share some of my insight after seeing too many bad questions that either get ignor

add to sql result
ok see rite now my sites hit counter is counted from the mysql visitor log i need to clear it aft

Send inserts to mysql thru port 80
Hi!

I have an application that must do some inserts in a mysql db. This db is behind a firewa

validating url
im trying to validate url's sent to me by a form
the url's im collecting are for placing banners

Probably a simple error...
I'm getting the error -- Parse error: syntax error, unexpected '{' in /home/content/c/s/t/csteffen24

System copy error in RUN ABAP REPORT PHASE
Hi,
I am performing system copy on my test server. I have previously taken export of JAVA + A

Take info from one coloum and move to another
Hi all,

I have this:
Code: [Select]$array = "SELECT stock_id FROM stocks WHERE stock_

Count
Getting the same count everytime

Code:
$visitquery = mysql_query("SELECT COUNT(*) FR

Sending CC Info by email
I am a little bit less knowledgable in the security area as most developers and I know I have a lot

Need help with an email blocker for a guessbook
I am new with php and here is a simple guessbook page but I am being hit with spam from a group of t

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