jjmusicpro Posted September 27, 2007 Share Posted September 27, 2007 Eekkk just cant figure it out, always comes back with a blank page <?php //Paused Clients Query parse_str("$QUERY_STRING"); $db = mysql_connect("localhost", "xxxx","xxxxxxx") or die("Could not connect."); if(!$db) die("no db"); if(!mysql_select_db("xxxxxxx",$db)) die("No database selected."); $acc1="SELECT * from zipcodes where on_off=2 group by groupe_name"; $acc2=mysql_query($acc1) or die("Could not select paused clients."); while($acc3=mysql_fetch_array($acc2)) { echo "<a href=\"paused.php?'$acc3[groupe_name]'"\>'$acc3[groupe_name]'</a>""; } ?> Link to comment https://forums.phpfreaks.com/topic/70924-query-db-and-get-results-into-hyperlink/ Share on other sites More sharing options...
KevinM1 Posted September 27, 2007 Share Posted September 27, 2007 Eekkk just cant figure it out, always comes back with a blank page <?php //Paused Clients Query parse_str("$QUERY_STRING"); $db = mysql_connect("localhost", "xxxx","xxxxxxx") or die("Could not connect."); if(!$db) die("no db"); if(!mysql_select_db("xxxxxxx",$db)) die("No database selected."); $acc1="SELECT * from zipcodes where on_off=2 group by groupe_name"; $acc2=mysql_query($acc1) or die("Could not select paused clients."); while($acc3=mysql_fetch_array($acc2)) { echo "<a href=\"paused.php?'$acc3[groupe_name]'"\>'$acc3[groupe_name]'</a>""; } ?> You have several typos in your last line. If you're echoing an array, you have to use curly brackets. You're also missing the variable name of the value you're trying to pass via GET (the something I added below). Try this for your last line, replacing something with what you're actually trying to pass along: <?php echo "<a href=\"paused.php?something={$acc3['groupe_name']}\">{$acc3['groupe_name']}</a>"; ?> Link to comment https://forums.phpfreaks.com/topic/70924-query-db-and-get-results-into-hyperlink/#findComment-356551 Share on other sites More sharing options...
mattal999 Posted September 27, 2007 Share Posted September 27, 2007 echo "<a href=\'paused.php?'$acc3[groupe_name]''>'$acc3[groupe_name]'</a>"; // no " allowed in echo! Link to comment https://forums.phpfreaks.com/topic/70924-query-db-and-get-results-into-hyperlink/#findComment-356552 Share on other sites More sharing options...
KevinM1 Posted September 27, 2007 Share Posted September 27, 2007 echo "<a href=\'paused.php?'$acc3[groupe_name]''>'$acc3[groupe_name]'</a>"; // no " allowed in echo! Wrong. Double-quotes can be put into double-quoted echoes, so long as they're escaped: <?php echo "I said \"hello, Mr. Smith\""; //This is okay ?> Link to comment https://forums.phpfreaks.com/topic/70924-query-db-and-get-results-into-hyperlink/#findComment-356553 Share on other sites More sharing options...
mattal999 Posted September 27, 2007 Share Posted September 27, 2007 oh, i didnt know that Link to comment https://forums.phpfreaks.com/topic/70924-query-db-and-get-results-into-hyperlink/#findComment-356559 Share on other sites More sharing options...
jjmusicpro Posted September 27, 2007 Author Share Posted September 27, 2007 Perfect! Ok, now it lists them in hyperlinks is there a way to count how many zips that were in the DB that has the on_off value set to 2 for each of these, and list it behind the hyperlinks for each person? Couldnt we just count the number of times each account shows up? since i am grouping them, i know they atleast have 1 lol thanks again everyone! Link to comment https://forums.phpfreaks.com/topic/70924-query-db-and-get-results-into-hyperlink/#findComment-356561 Share on other sites More sharing options...
jjmusicpro Posted September 27, 2007 Author Share Posted September 27, 2007 anyone? Link to comment https://forums.phpfreaks.com/topic/70924-query-db-and-get-results-into-hyperlink/#findComment-356599 Share on other sites More sharing options...
mattal999 Posted September 28, 2007 Share Posted September 28, 2007 try using mysqlnumrows: http://php.net/msql-num-rows Post back if you need help Link to comment https://forums.phpfreaks.com/topic/70924-query-db-and-get-results-into-hyperlink/#findComment-357378 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.