Jump to content

Recommended Posts

Hi i have this code:
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.Can anyone guild me?Thanks.
Link to comment
https://forums.phpfreaks.com/topic/28813-java-and-database-again/
Share on other sites

I have this:
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);

but my problem is how to insert the <?php echo $row_rs7['name'];?> into the Menu1_1=new Array("Member Listing","admin_database.php","",0,20,109);
I tried Menu1_1=<?php echo $row_rs7['name'];?> and the column name i put new Array("Member Listing","admin_database.php","",0,20,109); but it doesn't work..Plz help..
Er..I dun get what you mean.Anyway i have this:
Menu1=new Array("<img src='../frontpage-admin/menu-bar-wcm.gif'>","admin_theme.php","",7,48,108);
Menu1_1=new Array("Member Listing","admin_database.php","",0,20,109);
Menu1_2=new Array("Home","admin_home.php","",0,20,108);
Menu1_3=new Array("News & Events","admin_news.php","",0,20,108);
Menu1_4=new Array("About Us","admin_about.php","",0,20,108);
Menu1_5=new Array("Contact Us","admin_contact.php","",0,20,108);
Menu1_6=new Array("FAQs","admin_faq.php","",0,20,108);
Menu1_7=new Array("e-Education","admin_edu.php","",0,20,108);

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.
Er sorry i still blur..Can you write me out the code?Actually i know nothing much about java but my task is to set the link from the database.For the case menu2[1]='<?php echo $row_rs6['name'];?>' i am able to link it to database.But for this one Menu1_1=new Array("Member Listing","admin_database.php","",0,20,109); i tried out Menu1_1='<?php echo $row_rs7['name'];?>' but couldn't work.. help me..Thanks..
Er don't think so is the problem.The main problem is i don't know how to insert <?php echo $row_rs7['name'];?> into Menu1_1=new Array("Member Listing","admin_database.php","",0,20,109); for example: Menu1_1=<?php echo $row_rs7['name'];?> to get the data from the database.I tried this but failed and comes out the 'StartTop' is undefined problem when i load the page.The drop down list also become unavailable.Maybe am wrong with ' or " signs..
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.