Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rating: Thread Rating: 4 votes, 3.25 average.
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 05-29-2006, 02:23 PM   PM User | #1
rohit.vi
New to the CF scene

 
Join Date: May 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
rohit.vi is an unknown quantity at this point
Exclamation How to use Mysql Query inside Javascript functions?

Hello Everybdy,

I am trying to use Mysql Query inside a Javascript function, which also has php code. I am trying to use the on-click property of <a></a> tag, so as to call a javascript function, which is having an argument and this argument is being used by Mysql Query to check whether the table is empty, for that specific record.

If anybdy knows, whats the solution, please tell me!!!
Thanks in advance.
rohit.vi is offline   Reply With Quote
Old 05-29-2006, 03:24 PM   PM User | #2
fleshth
New Coder

 
Join Date: Oct 2005
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
fleshth is an unknown quantity at this point
mysql is database stuff, hence, server side. javascript is ONLY client side scripting. You may not interact with the server in any way (directly). However, You could use AJAX calls to like a php file that will return if the table is empty or not. But all in all, you can't use javascript itself to interface with mysql
fleshth is offline   Reply With Quote
Old 05-29-2006, 06:33 PM   PM User | #3
Single Paradox
Regular Coder

 
Join Date: Feb 2005
Posts: 525
Thanks: 0
Thanked 0 Times in 0 Posts
Single Paradox is an unknown quantity at this point
There is no way to do this outside of Ajax, of course you can always echo something in. Such as:

<script>

function doalert(){
alert('<?php echo($var) ?>');
}
</script>
__________________
Single Paradox
My Site (Under construction)

Not too bad for a 15 year old
Single Paradox is offline   Reply With Quote
Old 05-30-2006, 07:08 AM   PM User | #4
rohit.vi
New to the CF scene

 
Join Date: May 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
rohit.vi is an unknown quantity at this point
Thumbs up

Thanks for the replies, I too searched an answer, but everywhere I got the same answer that I need AJAX. Thanx again, this forum is very helpful.
rohit.vi is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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 On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 11:28 AM.


Advertisement
Log in to turn off these ads.