Solved

PHP inside <script>

Posted on 2006-11-23
2
1,095 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 143

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Google Dork query 7 63
How to use session variables in php? 22 46
Make check boxes work 8 43
Could you point what's preventing a remote MySQL server to be accessed? 8 37
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

756 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