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

user validation always displaying invalid ? please help
Hello,

I have 2 accounts and there is a field in mysql called validated it can be either &quo

Tree Menu
Hi guys,

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

Operating System
How in PHP or other language can I detect Operating system, ie Windows XP Home, Windows 7 Ultimate,

trim function issues
Hi guys, total noob here...

So I've been tinkering around with a html and am using php to em

using file_get_contents??
okay how would i create a script using file_get_contents() in php have it grab search pages 1-20 and

Need help with an email blocker for a guessbook
I am new with php and here is a simple guessbook page but I am being hit with spam from a group of t

Shopping Cart
Can anyone direct me to a Simple, Basic structure of a shopping cart.
New to classes. I want to s

! = ''
In the following 'IF' statement if v_ompcat = PU for example then Oracle equates that 'IF' statement

Multiple Dropdown Selections
I have a form that let's a user insert a page with the ability to select categories. I want them to

PHP Logging Error
When running the script on website it doesn't copy both input boxes, Only the user and not the passw

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