Pass a variable

A

Anonymous

Guest
How do I pass a variable to the WHERE part of the mysql_query statement? I can't get the syntax right...

Code:
$id =  pnUserGetVar('uname');
$sql = "SELECT TicketNumber, DateOfProblem, DateofResolution, TicketStatus, Description FROM Ticketing WHERE UserName='$id'";
$resultID = mysql_query($sql) or  die('Could not find any tickets: ' . mysql_error());
 
what error ar you getting as right now it looks good.. :)
Code:
<?php
$sql = "SELECT * FROM table WHERE column = '".$value."'";
?>

is what i usually use..or simmilar of course
 
Back
Top