'StartTop' problem..

Javascript coding ..

Moderators: macek, egami, gesf

teongkia
New php-forum User
New php-forum User
Posts: 14
Joined: Mon Nov 20, 2006 7:41 pm

'StartTop' problem..

Postby teongkia » Tue Nov 28, 2006 7:36 pm

Hi i have this code:
mysql_select_db($database_mConn, $mConn);
$query_rs7 = "SELECT * FROM example1 WHERE id='3'";
$rs7 = mysql_query($query_rs7, $mConn) or die(mysql_error());
$row_rs7 = mysql_fetch_assoc($rs7);
$totalRows_rs7 = mysql_num_rows($rs7);

Menu1_1=new Array("Member Listing","admin_database.php","",0,20,109);

How can i make it fetch the data from the column 'name' from the database?
How can i insert <?php echo $row_rs7['name'];?> into it?
I tried on this Menu1_1=<?php echo $row_rs7['name'];?> but it doesn't work.The error is 'StartTop" is undefined.I just want to set for Menu1_1 where i can change the link page(admin_database.php) from the database itself and do not need to go into code and change it.But i could not get what i wanted..Plz help..Thanks.Can anyone guild me?Thanks.

User avatar
WiZARD
Moderator
Moderator
Posts: 1257
Joined: Thu Jun 20, 2002 10:14 pm
Location: Ukraine, Crimea, Simferopol
Contact:

Re: 'StartTop' problem..

Postby WiZARD » Fri Mar 23, 2007 11:12 am

teongkia wrote:Hi i have this code:
mysql_select_db($database_mConn, $mConn);
$query_rs7 = "SELECT * FROM example1 WHERE id='3'";
$rs7 = mysql_query($query_rs7, $mConn) or die(mysql_error());
$row_rs7 = mysql_fetch_assoc($rs7);
$totalRows_rs7 = mysql_num_rows($rs7);

Menu1_1=new Array("Member Listing","admin_database.php","",0,20,109);

How can i make it fetch the data from the column 'name' from the database?
How can i insert <?php echo $row_rs7['name'];?> into it?
I tried on this Menu1_1=<?php echo $row_rs7['name'];?> but it doesn't work.The error is 'StartTop" is undefined.I just want to set for Menu1_1 where i can change the link page(admin_database.php) from the database itself and do not need to go into code and change it.But i could not get what i wanted..Plz help..Thanks.Can anyone guild me?Thanks.

can you show your full code and error what you get?

User avatar
Alexej Kubarev
Site Admin
Site Admin
Posts: 2223
Joined: Fri Mar 05, 2004 7:15 am
Location: Täby, Stockholms län
Contact:

Postby Alexej Kubarev » Wed Apr 11, 2007 2:17 am

first u forgot $infront of the variable..

are u mixing php and javascript?

how about u end ur php code with ?> first and then start javascript with a <script> tag?

then simply put <?php echo ..... ?>and so on?


Return to “JavaScript”

Who is online

Users browsing this forum: No registered users and 0 guests