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

$action = "insert"; //$action = $_GET['action'];
$action = "insert";
//$action = $_GET['action'];

why is this invalid type? I am

Need help urgant
why down my code ony return one item instead of all the items selected.

$arr = array($date,$

Procedural to OOP
John Kleijn said that to avoid writing "crappy code", we should learn OOP and common OO pr

User registration and login
I don't know whether this is the correct forum, if not i apologise but am pretty desperate at the mo

Local file browser with php
Halo..

So this is what i want to create. I have a folder that i share and it has many movies.

MySQL issue
I am taking sentences through a form on page. Then checking some condition and trying to insert them

form help
this doesn't work. i want the form action to go the location.href of the submit button chosen.. how

Save username into DB
OkaY so I got my blog to actually save the posts and whatever, all I need now is for it to keep the

image upload script not working with png
The basic process of this php code is to take the submitted file, convert it to a small JPG thumbnai

How to use Ajax to verify data on a DB ?
Hello everyone, well i want to know how to check a value if it exists or not on a Data base and capt

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