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?

Did you know?Explore Trending and Topic pages for more stories like this.
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

upload only text files
hi guys i want to upload only text like like (pdf,note pad and ofiice files) so can any one please t

Drop Down and text box issue
Is it possible to set a drop down list and text boxes to a certain width?

here is my code

Reading Most Recent CSV File in Directory
I thought I had wrapped this project up, but found out that the program I use to FTP a csv file to m

highlighting search terms
well, I started this in the regular PHP section, but it no longer fits there. Suffice it to say, I'm

login box shows up again after logging in 2nd login works
Hello,

I am having trouble on my site Lockerz.rack111.com where when you login the login box

how to use two buttons with php
hi i have one form. there are three fields which are to be filled by the user. and then there are tw

Looking for help reading a .txt or .ini file and outputting the info.
I have a file called Info.ini and It has the following info:
Code: [General]
Online=0
I wou

Preventing blank or already entered values
Im trying to learn how to place a read file line by line and prevent duplicate entries and also BLAN

UTL File problem
Hi
I have a file in certain path with the following permissions (The file is a dummy file witho

Sub-domains & calling unique content
Hello,

Is there a way use something similar to the $_GET function for a sub-domain? I to be a

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