Jump to content

MySQL and PHP help Needed With a Querry


woocha

Recommended Posts

Hey Guys....I can seem to find anything wrong with this code, can someone tell me what I am missing please?

 

<?
require('db_connect.php');
$query = "select * from merchant where merchant = $merchadmin";
$result	= "mysql_query( $query)";
if ($result){
while ($r = mysql_fetch_array($result))
{
	$siteid	= $r['site_id'];
	$email = $r['email'];
}
$wang = $r['site_id'];

echo "$wang";
echo "<br />";
echo "$merchantdir";
echo "<br />";
echo "$merchadmin";
echo "<br />";

echo date("F, d, Y @ g:iA");
echo "<br />";
//echo "$r['id']";
echo "<br />";
echo "$id";
echo "<br />";
echo "$siteid";
echo "<br />";
echo "$merch";
echo "<br />";
echo "$email";
echo "<br />";
echo "$item_numb";
}
else{
echo "its busted yo";
}
?>

Thank You

Link to comment
https://forums.phpfreaks.com/topic/82612-mysql-and-php-help-needed-with-a-querry/
Share on other sites

<?
require('db_connect.php'); // also add a die on you connection 
$query = "select * from merchant where merchant = $merchadmin";
$result	= mysql_query($query) or die(mysql_query());
if ($result){
while ($r = mysql_fetch_array($result))
	{
		$siteid	= $r['site_id'];
		$email = $r['email'];
	}
$wang = $r['site_id'];

echo "$wang";
echo "<br />";
echo "$merchantdir";
echo "<br />";
echo "$merchadmin";
echo "<br />";

echo date("F, d, Y @ g:iA");
echo "<br />";
//echo "$r['id']";
echo "<br />";
echo "$id";
echo "<br />";
echo "$siteid";
echo "<br />";
echo "$merch";
echo "<br />";
echo "$email";
echo "<br />";
echo "$item_numb";
}
else{
echo "its busted yo";
}
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.