[PHP] Re: Passing a PHP variable to javascript
This is one way to do it ?php echo SCRIPT LANGUAGE=\JavaScript\\n; echo !--\n; echo alert(\$text\)\n; echo //--\n; echo /SCRIPT\n; ? Chris On Mon, 19 Aug 2002 12:54:57 GMT, [EMAIL PROTECTED] (Michael) wrote: Hello everyone, This may seem a newbie question... I have a PHP variable containing the text of the alert I want to display ($text) and I want to have it displayed in a javascript alert box (something like alert($text) ). I couldn't find out how to sort this out... Regards, Michael __ Pour mieux recevoir vos emails, utilisez un PC plus performant ! Découvrez la nouvelle gamme DELL en exclusivité sur i (france) http://www.ifrance.com/_reloc/signhdell -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Rep:[PHP] Re: Passing a PHP variable to javascript
Nice, Thank you -Message d'origine- De: Chris Schoeman [EMAIL PROTECTED] A: [EMAIL PROTECTED] Date: 19/08/02 Objet: [PHP] Re: Passing a PHP variable to javascript This is one way to do it ?php echo SCRIPT LANGUAGE=\JavaScript\\n; echo !--\n; echo alert(\$text\)\n; echo //--\n; echo /SCRIPT\n; ? Chris On Mon, 19 Aug 2002 12:54:57 GMT, [EMAIL PROTECTED] (Michael) wrote: Hello everyone, This may seem a newbie question... I have a PHP variable containing the text of the alert I want to display ($text) and I want to have it displayed in a javascript alert box (something like alert($text) ). I couldn't find out how to sort this out... Regards, Michael ___ ___ Pour mieux recevoir vos emails, utilisez un PC plus performant ! Découvrez la nouvelle gamme DELL en exclusivité sur i (france) http://www.ifrance.com/_reloc/signhdell -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php __ Pour mieux recevoir vos emails, utilisez un PC plus performant ! Découvrez la nouvelle gamme DELL en exclusivité sur i (france) http://www.ifrance.com/_reloc/signhdell -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Passing a PHP variable to javascript
Hi, i am coding a news manager backend for a client and i ran into a little problem. I have two tables, one with the news and one with the comments on each news. How can i count how many comments there are for each news entry? Simply put, is there some sort of Mysql command query that can count how many records exist with a given field content? Example: Count on a database how many peters there are in there? Is there a specific SQL select or something, or i have to make a loop just to count them? Thanks. /Pag -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Passing a PHP variable to javascript
Look up on www.mysql.com documentation, you can do a count within a select statement SELECT whatever COUNT(whatever) AS COUNT FROM table GROUP BY 'something' HAVING something = 'something' -- | whatever | count | -- | stuff selected |50 | -- Adam On Mon, 19 Aug 2002, Pag wrote: Hi, i am coding a news manager backend for a client and i ran into a little problem. I have two tables, one with the news and one with the comments on each news. How can i count how many comments there are for each news entry? Simply put, is there some sort of Mysql command query that can count how many records exist with a given field content? Example: Count on a database how many peters there are in there? Is there a specific SQL select or something, or i have to make a loop just to count them? Thanks. /Pag -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php