MySQL Query

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Niko
Forum Newbie
Posts: 9
Joined: Tue Apr 20, 2004 6:17 am

MySQL Query

Post by Niko »

Im creating a recordset filters on orderPaymentReceived,
The code below works fine.

However i need to replace the "y" with a varible, $source which will hold with y or n.

$result = mysql_query("SELECT * FROM tblOrders WHERE orderPaymentReceived = 'y'");

//---------------------------------------------------
My previous attempt
$result = mysql_query("SELECT * FROM tblOrders WHERE orderPaymentReceived = ". $source);

Dosnt work.
ANy ideas
User avatar
dull1554
Forum Regular
Posts: 680
Joined: Sat Nov 22, 2003 11:26 am
Location: 42:21:35.359N, 76:02:20.688W

Post by dull1554 »

Code: Select all

$result = mysql_query("SELECT * FROM tblOrders WHERE orderPaymentReceived = '".$s0urce."'");
User avatar
Lord Sauron
Forum Commoner
Posts: 85
Joined: Tue Apr 20, 2004 5:53 am
Location: Tilburg, NL

Even too much

Post by Lord Sauron »

Code: Select all

<?php


$result = mysql_query("SELECT * FROM tblOrders WHERE orderPaymentReceived = ".$s0urce.";", "Cannot perform Query");

?>
Post Reply