matvespa Posted July 30, 2010 Share Posted July 30, 2010 Hi. I found a code online but unfortunately, the data is retrieved via variables. How can i convert this code to retrieve the data from database instead. Thank you in ADVANCE! var members = [ ['Steven B. Ayres', '1911-1913', 'New York', 'Independent Democrat', '1861-1929'], ['William Augustus Ayres', '1915-1921 1923-1934', 'Kansas', 'Democratic', '1867-1952'], ['William Hanes Ayres', '1951-1971', 'Ohio', 'Republican', '1916-2000'] ]; Quote Link to comment https://forums.phpfreaks.com/topic/209334-var-to-db-output/ Share on other sites More sharing options...
Adam Posted July 30, 2010 Share Posted July 30, 2010 That appears to be JSON created with JS. How are you querying the database? Quote Link to comment https://forums.phpfreaks.com/topic/209334-var-to-db-output/#findComment-1093084 Share on other sites More sharing options...
matvespa Posted July 30, 2010 Author Share Posted July 30, 2010 yup it is a js file. But how can i change it to php so that my data can be read via databasse. I have not done any query yet. Tried this but doesnt work. var = "SELECT * from table_name"; Quote Link to comment https://forums.phpfreaks.com/topic/209334-var-to-db-output/#findComment-1093303 Share on other sites More sharing options...
Adam Posted July 31, 2010 Share Posted July 31, 2010 To be honest mate I'd go back to basics; learn the fundamentals of PHP before attempting to query databases. Quote Link to comment https://forums.phpfreaks.com/topic/209334-var-to-db-output/#findComment-1093524 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.