Need help on javascript that counts how many rows are present in mysql that I can embed in an HTML file... I just don't know how to do it... Can anyone help me with this noob stuff I just want to display how many rows are present in a specific table in an HTML file using a simple javascript please help a javascript noob T__T
You cant do that as JavaScript is at client side and MySQL is on the server side. Though you cant do that with purely JavaScript you can however communicate with a server through an xmlhttprequest object, its referred to as AJAX (or activex, java, actionscript), though you will require PHP .
you could use javascript to fetch the content of a php file(you should echo the # here), and capture that value in your javascript ajax call. you can see how to use a simple ajax call here
You have to learn Ajax for that ... It is pretty simple ,even for a noob...Check out tutorials on the net for ajax. Also you will requires knowledge of one server side language like php,perl...etc etc
hehehe.. i finally got it thanks anyway for the help guys i just used the mysql_num_rows function to count the rows.. it's all that i'm looking for.. heehee