Solved

PHP inside <script>

Posted on 2006-11-23
2
1,096 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

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

Suggested Solutions

Generating table dynamically is the most common issue faced by php developers.... So it seems there is a need of an article that explains the basic concept of generating tables dynamically. It just requires a basic knowledge of html and little maths…
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.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to count occurrences of each item in an array.

710 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