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
12
Other forums
Kill a process
I have a question - how can I kill a process from a command line or by using Oracle SQL Developer? I
max() problem
I have a while loop to get image names.
Code: $imagequery = mysql_query("SELECT * FROM ad_i
how to populate a drop down box
Hi buddies!
PROCEDURE DOWNLOAD_REPORT_FORM (report_name varchar)
is
begin
DOWNLO
Socket programming
Hello all,
I have a PHP socket script. GPS trackers connect to this socket. IMEI verification
Comparing two dates
Hi Guys
I have two dates I want to compare. Below is my current implementation. The problem with
replacements
I have a variable in my PHP script like
ASSFDDDDDDDDDDDDDASDDDDDDDDARYTRHKKHHHHHHHHHHH and p
Login Control?!
I have a Web Site that uses the login control also I have set the destinationurl to the page I want
Motivational Posters
Hello,
I wonder how can i do them in php. Are there any sample codes that you can show me?
Appending GET data with form submition
Okay, what I'm trying to do is to use a form to append an already existing GET data string.
I
PHP Redirecting
Hello everyone. Is there a way to redirect people to pages within a statement in PHP? Since there is