it works!!! Posted December 27, 2008 Share Posted December 27, 2008 After posting the selected category and the subcategory the names of respective objects from the DATABASE in div "objects" ne the same page with the form that has this layout: this is the php code: <?php include("dbinfo.php"); $connection = mysql_connect("server",$username,$password); if (!$connection) { die('Not connected : ' . mysql_error()); } $db_selected = mysql_select_db($database, $connection); if (!$db_selected) { die ('Can\'t use db : ' . mysql_error()); } $result1=mysql_query("Select idg from Grupimi where grupim='$_POST[category]' and detaje='$_POST[subcategory]'") or die(mysql_error()); $row1 = mysql_fetch_array($result1); $klasifikimi = $row1['idg']; $result2=mysql_query("Select oemer from Objekt where klasifikimi='$klasifikimi'") or die(mysql_error()); <? }else{ while($row2 = mysql_fetch_array($result2)){ echo $row2['oemer']; echo "<br/>"; } } mysql_close($connection); ?> Quote Link to comment Share on other sites More sharing options...
chronister Posted December 27, 2008 Share Posted December 27, 2008 That is as clear as mud. Please explain in a little more detail what you are hoping to accomplish. Nate Quote Link to comment Share on other sites More sharing options...
it works!!! Posted December 27, 2008 Author Share Posted December 27, 2008 ok! Look at this picture and maybe you'll understand better. Thank you! Quote Link to comment Share on other sites More sharing options...
it works!!! Posted December 27, 2008 Author Share Posted December 27, 2008 Quote Link to comment Share on other sites More sharing options...
Yesideez Posted December 27, 2008 Share Posted December 27, 2008 Hello gerta, I will continue to help you on here instead Quote Link to comment Share on other sites More sharing options...
Yesideez Posted December 27, 2008 Share Posted December 27, 2008 I need this: 1. The name of your script that makes that form 2. The code for the page (surrounded in CODE tags) Quote Link to comment Share on other sites More sharing options...
it works!!! Posted December 27, 2008 Author Share Posted December 27, 2008 Can you work in the other forum please cause i have posted there the code? Thank you again! Quote Link to comment Share on other sites More sharing options...
Yesideez Posted December 27, 2008 Share Posted December 27, 2008 OK where's the PHP code - that's just the HTML? You can do what I do and incorporate your PHP and HTML into one page - here's an example... <?php $strName=$_POST['name']; if ($_POST['subshow']) { //user clicked submit so validate here } ?> <html> <head> <title>My Page</title> </head> <body> <form action="<?=$_SERVER['PHP_SELF']?>" method="post"> Name: <input type="text" name="name" value="<?=$strName?>" /><br /> <input type="submit" name="subshow" value="Show Data" /> </form> You entered: <?=$strName?> </body> </html> EDIT: When showing data inside a textbox do it like this: <textarea name="mytextbox" cols="40" rows="7"><?=$txtSomeText?></textarea> Quote Link to comment Share on other sites More sharing options...
448191 Posted December 29, 2008 Share Posted December 29, 2008 TS, please stop using "PLEASE HELP!!!!"/"URGENT!!!!"-type titles. Thank you. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.