Hello all, I am fairly new to php etc, and I have a database
1) I have already did a search for: "Results within results" on this site, in PHP & MySQL forums ( I think) properly...and one search resulted in over 100 pages etc.
From the below structure of my DB, I would like to get the code from the below URL working on my existing data I have, but I am having trouble and I am just getting flustered....
I would eventually like to have the user "select" first a $State and then $County from a "drop down" for now, and eventually a "map" but the "drop down" for these (2) will be a must have....but I am just trying to use this function first.
At present, I am unable to even get proper printed results, and I know it has to do with something on the variable call end that is screwing me up.
2) This is what I am using (learning) from:
3) This is my mySQL db structure:
4) I am also referencing the extract() function here:
5) Here is the code I presently am playing with, as I want to for now just print out Phone, Name Address for now to get my feet wet with this function call.
[PHP]
$result = mysql_query("SE LECT ID, Phone FROM skylos;");
// Already connected above
while ($row = mysql_fetch_ass oc($result)) {
extract($row, EXTR_PREFIX_ALL , "conf");
print "<B>Busines s answering at $conf_Phone:</B><br />";
$subresult = mysql_query("SE LECT ID, Phone FROM skylos WHERE Address = $conf_ID;");
while ($subrow = mysql_fetch_ass oc($subresult)) {
extract($subrow , EXTR_PREFIX_ALL , "Address");
print " $Address_Addres s<br />";
}
print "<br />";
}
?>
[/PHP]
Thx all in advance for any help.
jim
1) I have already did a search for: "Results within results" on this site, in PHP & MySQL forums ( I think) properly...and one search resulted in over 100 pages etc.
From the below structure of my DB, I would like to get the code from the below URL working on my existing data I have, but I am having trouble and I am just getting flustered....
I would eventually like to have the user "select" first a $State and then $County from a "drop down" for now, and eventually a "map" but the "drop down" for these (2) will be a must have....but I am just trying to use this function first.
At present, I am unable to even get proper printed results, and I know it has to do with something on the variable call end that is screwing me up.
2) This is what I am using (learning) from:
3) This is my mySQL db structure:
Code:
mysql> desc skylos; +---------------+------------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +---------------+------------------+------+-----+---------+----------------+ | id | int(10) unsigned | NO | PRI | NULL | auto_increment | | Type | text | NO | | NULL | | | Name | text | NO | | NULL | | | Address | text | NO | | NULL | | | City | text | NO | | NULL | | | County | text | NO | | NULL | | | State | text | NO | | NULL | | | Zip | text | NO | | NULL | | | Phone | text | NO | | NULL | | | Email_Exists | text | NO | | NULL | | | Email_Address | text | NO | | NULL | | | Website | text | NO | | NULL | | +---------------+------------------+------+-----+---------+----------------+ 12 rows in set (0.00 sec)
5) Here is the code I presently am playing with, as I want to for now just print out Phone, Name Address for now to get my feet wet with this function call.
[PHP]
$result = mysql_query("SE LECT ID, Phone FROM skylos;");
// Already connected above
while ($row = mysql_fetch_ass oc($result)) {
extract($row, EXTR_PREFIX_ALL , "conf");
print "<B>Busines s answering at $conf_Phone:</B><br />";
$subresult = mysql_query("SE LECT ID, Phone FROM skylos WHERE Address = $conf_ID;");
while ($subrow = mysql_fetch_ass oc($subresult)) {
extract($subrow , EXTR_PREFIX_ALL , "Address");
print " $Address_Addres s<br />";
}
print "<br />";
}
?>
[/PHP]
Thx all in advance for any help.
jim
Comment