473,386 Members | 1,734 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

PHP MySQL JavaScript innerHTML

I would like to display data from a MySQL DB on a PHP page after it has been rendered. I know I could use JavaScript's innerHTML but I don't know the most intelligent method of getting a dataset to the page from the MySQL DB.

Is there a "best" way to get a dataset to the page and then have JavaScript parse through it showing one item at a time? I can parse through the set but don't know what I should use to hold the set.

There will be data coming from the MySQL DB for each div meaning all five. Do I use 5 arrays or is there a more correct way of doing this?

Thanks

Expand|Select|Wrap|Line Numbers
  1. <form class="my_frm" name="sm_main">
  2. <div class="my_scr">Which Library</div>
  3. <div class="my_bk">Which Book </div>
  4. <div class="my_ref">Which page and line</div>
  5. <div class="my_prompt">Author and Date</div>
  6. <div class="my_vrs">Place information here</div>
  7. </form>
  8.  
Mar 28 '11 #1
2 2401
You may use AJAX for adding data to webpage after it has been loaded.
First create a XMLHttp request object using javascript,which will be sended to a .php script at server side and the response from php script will be parsed through javascript without any page refresh.
A simple tutorial on AJAX may be found at http://www.w3schools.com/ajax/
Mar 29 '11 #2
I will read up on AJAX. Thanks
================================================== ================================================== ==================
Mar 29 '11 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Chris | last post by:
How can I get the innerHTML of a <div> area only when the page loads, then use that variable in a function? Here is my code: function setContent(zz) { var lb =...
9
by: Jaap Zuidersma | last post by:
My question is the following: I have a javascript that should open a page from a subdir on my website: /image html/file.htm It has to do this via a link: <A href="functionname('file.htm') The...
5
by: Dennis Fazekas | last post by:
Greetings, I am creating a web form which will all the user to add an unlimited number of email addresses. Basically I have 3 buttons, "Add Another Email", "-" to remove, and a "Save" button....
4
by: Henry | last post by:
Hi I have a problem, pls see below: <html> : <script type="text/javascript"> <!-- function addCode () { document.getElementById('emptySpace').innerHTML+=
3
by: Tarik Monem | last post by:
Just the other day, I received help from this forum on escape sequences with some PHP code which would echo a Javascript onclick. After the reply helped me, I asked him to explain why it worked...
3
by: Noorain | last post by:
i use php,mysql & javascript for this project. i use textbox for phone. i use 11 digit for that. first 3 digit(017) fixed for that.when cursor focus that field auto 017 set there. don't delete or...
2
by: sheldonlg | last post by:
Erwin Moller wrote: This goes along with what I have experienced. I recently (a few months bsck) started working in an AJAX framework. I quickly found that if I replaced some php code...
2
by: =?Utf-8?B?cm9kY2hhcg==?= | last post by:
hey all, i'm in a gridview edit row that has a DropDownList in one column and a status Label in the 2nd column. When i changed the value in the dropdownlist, there's a client-side javascirpt...
3
by: ganihskmca | last post by:
The following are the program i did...... and the problem im getting is object expected in onchange function at line 27(where i marked that one in bold for ur ease of identifying the error occuring...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.