Switch to full style
Dynamic open source server-side web development
Post a reply

PHP variable in javascript

Wed Apr 08, 2009 8:12 pm

Hi,
I am creating web page with php, mysql and javascript. Menu items are printed from db
Code:
$db = new Database($config['server'], $config['user'], $config['pass'], $config['database'], $config['tablePrefix']);
$db->connect();
$sql = "SELECT lt FROM meniu";
$countRows = $db->query($sql);
while ($countRow = $db->fetch_array($countRows)) {
echo "<li class='sub'><a href='javascript:void(0)' onclick='open_url('content.php?id=','my_site_content');'>".$countRow['lt']."</a></li>";
}
$db->close();

after ?id= should be meniu item id. Could someone write which variable to write?



Post a reply
  Related Posts  to : PHP variable in javascript
 different between Local variable and Global variable     -  
 Variable interpolation     -  
 transient variable     -  
 Unset variable     -  
 Passing a Reference Variable     -  
 Variable Size Arrays     -  
 how to call a global variable?     -  
 Delete session variable     -  
 Testing the Type of a Variable     -  
 static variable defined in function     -