likemaddy Posted July 25, 2012 Share Posted July 25, 2012 Hi To Every one. This is my first day on phpfreaks. i am here becouse of java script problerm. i have a table of images in mysql and i want to show all the images as pop up. i dont want to submit the page thats why i prefer javascript for this. i am also new for php and javascript. can please any body help me ? Thanks in advance Quote Link to comment https://forums.phpfreaks.com/topic/266204-select-query-using-javascript/ Share on other sites More sharing options...
likemaddy Posted July 25, 2012 Author Share Posted July 25, 2012 i have the all images in php array. $array[$i]; and i can pop also using the script window.open("file_display.php?id=18","Homepage","resizable=no,status=no,scrollbars=no,height=320,width=230,left=490,top=320,menubar=no,addressbar=no"); i dont know how can i use array item as id no or i dont know how to run select * from table name query in javascript. help me plz Quote Link to comment https://forums.phpfreaks.com/topic/266204-select-query-using-javascript/#findComment-1364165 Share on other sites More sharing options...
gristoi Posted July 25, 2012 Share Posted July 25, 2012 have a google on using ajax to make a call to a database Quote Link to comment https://forums.phpfreaks.com/topic/266204-select-query-using-javascript/#findComment-1364203 Share on other sites More sharing options...
Adam Posted July 25, 2012 Share Posted July 25, 2012 You can't run a select query directly using JavaScript. Although you can use AJAX, which allows you to send a request in the background to a PHP script to get the results. If you're dealing with a relatively small amount of data though, it might make sense to just to echo the data into a JS variable to start with: <script type="text/javascript"> var data = <?php echo json_encode($array) ?>; </script> Quote Link to comment https://forums.phpfreaks.com/topic/266204-select-query-using-javascript/#findComment-1364312 Share on other sites More sharing options...
likemaddy Posted July 28, 2012 Author Share Posted July 28, 2012 Thanks for Reply i did it with another way. now i am displaying my all select image in a new PHP page all is working fine Thanks to all Quote Link to comment https://forums.phpfreaks.com/topic/266204-select-query-using-javascript/#findComment-1365015 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.