Please support our PHP advertiser: Lunarpages PHP Web Hosting
![]() |
Hi!
I am using a code to echo a row in a database table using ajax.
The code is working correctly.
The ajax will send the response text as follows-
My question is how can I retrieve individual fields into separate Id's?
I am using a code to echo a row in a database table using ajax.
The code is working correctly.
The ajax will send the response text as follows-
document.getElementById('outputText').innerHTML = httpObject.responseText;My question is how can I retrieve individual fields into separate Id's?
My blog on .NET- http://dotnet.tekyt.info
Hi..
With Ajax, the best way to code is leave the innerHTML blank.. As in dont code anything inside the div tag.. e.g. <div id="outputText"></div>
Do not put any design in the DIV tag.. Rather, put your design layout in the php file which you access through AJAX..
like...
Suppose $row is the array (whose value is taken from mysql_fetch_array)
Now you can put this layout from the php file which is called from AJAX in the innerHTML property of the div tag..
This is the best way i could find for using AJAX.
With Ajax, the best way to code is leave the innerHTML blank.. As in dont code anything inside the div tag.. e.g. <div id="outputText"></div>
Do not put any design in the DIV tag.. Rather, put your design layout in the php file which you access through AJAX..
like...
Suppose $row is the array (whose value is taken from mysql_fetch_array)
[color] echo "<table border='0' width='100%'>"; echo "<tr>"; echo "<td>"; echo $row[0]; echo "</td></tr>"; echo "<tr>"; echo "<td>"; echo $row[1]; echo "</td></tr>"; echo "</table>"; [/color]
Now you can put this layout from the php file which is called from AJAX in the innerHTML property of the div tag..
This is the best way i could find for using AJAX.
![]() |
Similar Threads
Other Threads in the PHP Forum
- Upload image using PHP and AJAX (PHP)
- AJAX & PHP Developer ( Full Time ) (Web Development Job Offers)
- PHP/AJAX/Javascript/Mysql - Master - NO FREELANCE (Los Angeles) (Software Development Job Offers)
- javascript / ajax tutorials (JavaScript / DHTML / AJAX)
- PHP/AJAX Developer (Web Development Job Offers)
- PHP Ajax Search (PHP)
- Levyo Ajax Technology Gallery (JavaScript / DHTML / AJAX)
Other Threads in the PHP Forum
- Previous Thread: ***** User Login problem *****
- Next Thread: Php And HTML Mixed?
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)





Linear Mode