PHP Database Handling | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

PHP Database Handling

I have a page with 6 different events, all loaded from database. When i click one event, a pop up appears with all the details of that event. I cant figure out how to do so. I dont know whether we can execute query using JS or jquery. Can anyone help what should i do? All the handling needs to be done on same page. i am unable to figure out how to use click function to do so. Help will be greatly appreciated.Thanks.

24th Jan 2017, 8:01 PM
Syed Muhammad Dawoud Sheraz Ali
Syed Muhammad Dawoud Sheraz Ali - avatar
5 Answers
+ 4
use PHP to get response from database, print JSON data or html data, and you can request that PHP file using ajax. Get response using ajax from PHP file and print it on webpage. Using jQuery or JavaScript to connect or use database, you can easily hacked. People can see your database details.
25th Jan 2017, 2:19 AM
Aditya kumar pandey
Aditya kumar pandey - avatar
0
if there are only 6 events it shoulnd be so much Data. you can simply load it, put every event in its popup div (better than js popup) do css display: none at start. and then onclick or hover -> display: block or something...
25th Jan 2017, 10:48 AM
KiX
0
i have to agree, json or ajax would be the route to go
25th Jan 2017, 12:13 PM
Andre van Rensburg
Andre van Rensburg - avatar
0
well event will be randomly selected from database. So what i understand is that I send the query via JS or jquery and get the response. and the populate that response in the proper divs?
25th Jan 2017, 2:42 PM
Syed Muhammad Dawoud Sheraz Ali
Syed Muhammad Dawoud Sheraz Ali - avatar
0
use ajax
25th Jan 2017, 5:27 PM
Ali Naqi Shah
Ali Naqi Shah - avatar