adamjones Posted February 22, 2009 Share Posted February 22, 2009 Hi. I have this code; <?php session_start(); require_once('config.php'); $link = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD); if(!$link) { die('Failed to connect to server: ' . mysql_error()); } $db = mysql_select_db(DB_DATABASE); if(!$db) { die("Unable to select database"); } $qry="SELECT * FROM `members` WHERE `username`='"$rows['user']."'"; $result=mysql_query($qry); $getbadge = mysql_query($qry) or die(mysql_error()); if($result) { while ($row = mysql_fetch_array($getbadge)) { $imgs = explode(",",$row['badges']); foreach ($imgs as $v) { echo "<img src='badges/".$v.".gif' alt='".$v."'>"; } } }else { echo "<p>".$error."</p><br>"; } ?> The problem is this bit; WHERE `username`='"$rows['user']."'"; I know that it's not ""$rows['user']."'"; I just don't know what it is... :/ Cheers Link to comment https://forums.phpfreaks.com/topic/146403-solved-need-help-with-this-please/ Share on other sites More sharing options...
Philip Posted February 22, 2009 Share Posted February 22, 2009 You need a period [.] before the $rows $qry="SELECT * FROM `members` WHERE `username`='".$rows['user']."'"; Link to comment https://forums.phpfreaks.com/topic/146403-solved-need-help-with-this-please/#findComment-768661 Share on other sites More sharing options...
adamjones Posted February 22, 2009 Author Share Posted February 22, 2009 You need a period [.] before the $rows $qry="SELECT * FROM `members` WHERE `username`='".$rows['user']."'"; Thanks Link to comment https://forums.phpfreaks.com/topic/146403-solved-need-help-with-this-please/#findComment-768663 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.