Please help - should be a simple fix.. driving me nuts


Posted on 16th Feb 2014 07:03 pm by admin

Everything seemed to be working fine. I have a table, it alphabetically lists a bunch of cities and relivant city data.

However, I found out that the city is showing up only one time when I have can have more than one rows with that City name.. I.e. - I should have 15 rows that are all "Jacksonville" but I am only seeing one. I guess my code is eliminating what it thinks are duplicates?

Here is my code (I renamed field names for communication purposes)



$dbhandle = mysql_connect($hostname, $username, $password)
or die("Unable to connect to MySQL");

$selected = mysql_select_db("companies",$dbhandle)
or die("Could not select companies");

$query = mysql_query("SELECT* FROM companies GROUP BY City");
while ($row = @mysql_fetch_array($query))


{

$variable1=$row["Email"];
$variable2=$row["WEB"];



echo "<tr bgcolor="#dddddd"><td><center>";
echo $row["City"];
echo ($variable2 != '') ? "<a href="$variable2"></br> Website</a>" : '';
echo ($variable1 != '') ? "<a href="mailto:$variable1">Email</a>" : '';
echo ltrim($row[""], '0');
}?>

No comments posted yet

Your Answer:

Login to answer
145 Like 26 Dislike
Previous forums Next forums
Other forums

firefox wouldnt stream mp3 files completely from my php page
hi everyone,
I have a php file trying to read and stream mp3 files. It works fine in IE but my pr

Set Categories
I am creating a submission form for somebody to come in and submit products. These products are sep

Tree Menu
Hi guys,

Can anyone help me making a tree navigation system? I have a site where I'm allowin

Count
Getting the same count everytime

Code:
$visitquery = mysql_query("SELECT COUNT(*) FR

Got A Free Server :(
So I was given a free server

http://shopping.yahoo.com/p:Compaq%20ProLiant%201500%20Server:1

ereg_replace in Wordpress
Heya - so I'm working on this site: http://world-of-smiles.theportlandco.com/new-patients

The

Internal Server Error issues
This has been bothering me for weeks and I've been trying to solve it without asking for help, but e

Best PHP Documentation generator
Hello guys!

I would like to hear from you what is the best PHP documentation generator. Perso

PHP url branch??
Functionally, using PHP, I'm doing a test of login input submitted by a user via an html form in a f

error help - Dynamic Image
I've been working on making my site less cluttered in the directories and more secure lately. In an

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash