Current location: Hot Scripts Forums » General Web Coding » JavaScript » JavaScript to connect to MySQL


JavaScript to connect to MySQL

Reply
  #1 (permalink)  
Old 04-13-04, 02:54 PM
perleo perleo is offline
Coding Addict
 
Join Date: Jul 2003
Location: Ireland
Posts: 269
Thanks: 0
Thanked 0 Times in 0 Posts
JavaScript to connect to MySQL

I have a javascript that makes a tree menu. But i need it to pull the titles from a mysql db and display them in the tree. Iam using php pages with the javascript imbedded in it, or can someone show me a way to integrete the php variables into the javascript.

Here the javascript.

var TREE1_NODES = [
['<b>Home</b>', 'main.php', 'mainFrame'],
['<b>Books</b>', null, 'mainFrame'],
['Operating Systems', null, 'mainFrame',
['Linux', 'books.php?catid=', 'mainFrame'],
['Windows', 'books.php?catid=', 'mainFrame'],
], //Operating System closing
['Networking', null, 'mainFrame',
['TCP/IP', 'index.html', 'mainFrame'],
['IPv6', 'index.html', 'mainFrame'],
], //Networking closing
//BOOKS Closing
['<b>DVDs</b>', null, 'mainFrame'],
['Operating Systems', null, 'mainFrame',
['Linux', 'index.html', 'mainFrame'],
['Windows', 'index.html', 'mainFrame'],
], //Operating System closing
['Networking', null, 'mainFrame',
['TCP/IP', 'index.html', 'mainFrame'],
['IPv6', 'index.html', 'mainFrame'],
], //Networking closing



]; //MAIN

So i need to do a
PHP Code:

 while($result mysql_fetch_array($query))

{
 
$title $result['title'];
 echo 
"['"title"', 'index.html', 'mainFrame'],";

But the doesnt work.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP and MySQL ? rob2132 Hot Scripts Forum Questions, Suggestions and Feedback 4 08-29-08 02:22 AM
Error while creating database (Errornumber 2002: "Can't connect to local MySQL server lylesback2 PHP 5 04-11-04 01:37 PM
Getting MySQL cannot connect error NCC1701 PHP 2 04-05-04 08:30 PM
Can't connect to local MySQL ERROR Abdul PHP 1 03-27-04 02:43 PM
I need a bit of help, with MySQL connect H-a-V-o-C_88 PHP 4 12-03-03 02:05 PM


All times are GMT -5. The time now is 02:14 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.