Jump to content

Recommended Posts

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

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>";

?>

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

?>

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!

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.