PHP MySQL Return Results Issue


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

Hi guys,

I'm running joomla and made a module which is using ajax.
Basically i just have an html input textbox which i put a SQL statement in and then onblur it does the ajax script which returns the query results.

my sql query: "SELECT * FROM jos_users"

So, why does this:
Code: $result = mysql_query($query);

while ($row = mysql_fetch_array($result))
{
for ($x=1; $x<=count($row); $x++)
{
echo $row[$x]."<br />";
}
}

return this:
QuoteAdministrator
admin
your-email@email.com
21232f297a57a5a743894a0e4a801fc3
Super Administrator
0
1
25
2005-09-28 00:00:00
2009-10-14 13:11:45

while this:
Code: $result = mysql_query($query);

while ($row = mysql_fetch_array($result))
{
foreach ($row as $item)
{
echo $item."<br />";
}
}

return this:
Quote62
62
Administrator
Administrator
admin
admin

your-email@email.com
21232f297a57a5a743894a0e4a801fc3
21232f297a57a5a743894a0e4a801fc3
Super Administrator
Super Administrator
0
0
1
1
25
25
2005-09-28 00:00:00
2005-09-28 00:00:00
2009-10-14 13:11:45
2009-10-14 13:11:45

Thanks for any light you can shed.

No comments posted yet

Your Answer:

Login to answer
308 Like 19 Dislike
Previous forums Next forums
Other forums

uploading video files into mysql in php
hi,
I have the video files which i have to upload into mysql db. along with creating thumbnails f

PHP and Javascript
Hi Guys,

Im trying to load the contents of an html file into a text area for editing, this is

ok i need to join all this pages to make 1 neat code
i have 5 pages that make up my tv guide it works 100% but i want to make it 1 page if i can or 2, i

Quick fix: Conditional statement with an array
Hi, I'm getting the temperature value off of the Environment Canada website along with the icon file

What's best way to get a user's Word doc converted to simple html and images?
Hi all,

I was just wondering if anybody has any experience of this.
Basically, I'm buildin

Simple Scraper... Weird Output
Okay, maybe I just need a Blue Monster and some sleep, but....

I'm scraping a ringtone site

'grab_files', multiple extension?
hey guys,

can anyone suggest a way to make to following line of code look for files with more

PHP and XML image gallery variable issue
I'm trying to display the large image on the same page as the thumbnails, to do that I'm passing a v

Allegro crashes when running load_bitmap. Why?
I can not get Allegro to load any BMP images. Here is a section of test code. The picture is in the

how to transport the Query and insfoset
Hi

I have created the query using SQ01........
How to created T-code for query..

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