TGWSE_GY Posted September 22, 2009 Share Posted September 22, 2009 okay I have a form that is suppose to display contents retrieved from the database. However all the other forms work but this one. Could someone point me in the right direction please? home.php <?php $dbhost = "**********"; $dbuser = "*********"; $dbpass= "**********"; ?> <?php $dbtbl = "home"; $dbname = "innonmainnj"; ?> <?php $conn = mysql_connect($dbhost, $dbuser, $dbpass) or die(mysql_error()); ?> <?php mysql_select_db($dbname) or die(mysql_error()); ?> <?php $query = "SELECT * FROM `$dbtbl` WHERE id = '1'"; ?> <?php $result = mysql_query($query) or die(mysql_error()); ?> <?php if(mysql_num_rows($result) == 1){$returned = mysql_fetch_assoc($result);}else{echo "Table accommodations is not valid, please contact system administrator"; die();} ?> <div id="form_container"> <h1><a>Home Page</a></h1> <form id="form_108881" class="appnitro" method="post" action="proccess.form.php"> <div class="form_description"> <h2>Home Page</h2> <p>You are now editing your Home Page</p> </div> <ul > <li id="li_1" > <label class="description" for="element_1">Home Content </label> <div> <textarea id="element_1" name="element_1" class="element textarea medium"><?php echo stripslashes($returned['content']); ?></textarea> </div> </li> <li id="li_2" > <label class="description" for="element_2">Promo Title </label> <div> <input id="element_2" name="element_2" class="element text large" type="text" maxlength="255" value="<?php echo stripslashes($returned['promotitle']); ?>"/> </div> </li> <li id="li_3" > <label class="description" for="element_3">Promo </label> <div> <input id="element_3" name="element_3" class="element text large" type="text" maxlength="255" value="<?php echo stripslashes($returned['promo']); ?>"/> </div> </li> <li id="li_4" > <label class="description" for="element_4">Address Line 1 </label> <div> <input id="element_4" name="element_4" class="element text large" type="text" maxlength="255" value="<?php echo stripslashes($returned['address1']); ?>"/> </div> </li> <li id="li_5" > <label class="description" for="element_5">Address Line 2 </label> <div> <input id="element_5" name="element_5" class="element text large" type="text" maxlength="255" value="<?php echo stripslashes($returned['address2']); ?>"/> </div> </li> <li id="li_6" > <label class="description" for="element_6">Phone Number </label> <div> <input id="element_6" name="element_6" class="element text medium" type="text" maxlength="255" value="<?php echo stripslashes($returned['phone']); ?>"/> </div> </li> <li class="buttons"> <input type="hidden" name="form_id" value="108881" /> <input id="saveForm" class="button_text" type="submit" name="submit" value="Submit" /> </li> </ul> </form> <div id="footer"> inkControl CMS © <?php echo date(Y); ?> <a href="http://www.visualrealityink.com">Visual Reality ink.</a> </div> </div> Thanks Quote Link to comment Share on other sites More sharing options...
samshel Posted September 22, 2009 Share Posted September 22, 2009 r u sure the following query is returning any records from the DB ? SELECT * FROM `home` WHERE id = '1' Quote Link to comment Share on other sites More sharing options...
TGWSE_GY Posted September 22, 2009 Author Share Posted September 22, 2009 Yup it is Quote Link to comment Share on other sites More sharing options...
TGWSE_GY Posted September 22, 2009 Author Share Posted September 22, 2009 Ok still not sure what was wrong but now it is working, I will look into it and post the solution later. Thanks Guys you are all always such a great help!! 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.