Solved

PHP inside <script>

Posted on 2006-11-23
2
1,093 Views
Last Modified: 2008-01-09
Hi,

Please assist how can we insert the number of rows returned from mysql into the varaiable myCells.

Thanks.

<script>
var myCells = [
["Test1","Ok"],
["Test2","<?PHP echo mysq_row_count($datasetTest); ?>"]   <-----------error
];

.....

</script>
0
Comment
Question by:FrankPorter
2 Comments
 
LVL 142

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 500 total points
ID: 18002621
><-----------error
what error?

now:
>mysq_row_count
looks like you have a typo, ie a "l" missing:
mysql_row_count

if that doesn't help, can you show the code that created the $datasetTest?
possibly, the query is not correct.
0
 

Author Comment

by:FrankPorter
ID: 18002857
should be mysql_num_rows
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

947 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now