Jump to content

jas21

New Members
  • Posts

    6
  • Joined

  • Last visited

jas21's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hello experts, I want to populate names from database records and then edit selected name row by clicking onthe edit button. Below is the code for the same: <form action="update.php"> <fieldset> <legend>Adding Fresh Lead</legend> Name: <select name="name1"> <option value="1">Alison</option> <option value="2">jack</option> <option value="3">thomas</option> <option value="4">roy</option> </select> <input type="submit" value="Edit" /><br> <p><label for="name">Name</label> <input type="text" name="name"/></p> <p><label for="email">E-mail</label> <input type="text" name="email" /><br /></p> <p><label for="contact">Contact</label> <input type="text" name="contact" /><br /></p> <p><label for="requirement">Requirement</label> <input type="text" name="requirement" /><br /></p> <p><label for="date">Date</label> <input type="text" name="date" value="<?php $b = time (); print date("d/m/y",$b) ; ?> " /><br /></p> <p><label for="priority" name="priority" >Priority</label> <select name="priority"> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> </select> <br /></p> <p><label for="priority" name="priority" >Status</label> <select name="priority"> <option value="1">Open</option> <option value="2">Close</option> <option value="3">Inprocess</option> </select> <br /></p> <p><label for="price">Price </label> <input type="text" name="price" /><br /></p> <p><label for="followup">Follow-Up</label> <input type="text" name="followup" /><br /></p> <p class="submit"><input type="submit" value="Update" /></p> </fieldset> </form> I want to populated all my names from database if i place any alphabet in the textbox name1. I want to search name by keywords as the first alphabet of name. I have tried a lot but dint came to a conclusion. Really not understanding. So if some one can just help me out with the code. I have used the below query for editing: $result = mysqli_query($con,"SELECT * FROM persons where name1=' . $txt1'"); But now i am confused to populate name in textbox and then i have to edit the form. I hope i have explained it fine. Please some one can help me out here. Any help is apprecited.
  2. Thanks a lot of replying. But did u run the code because the serverside script is not working. Or may be i am wrong. But i do tried it out and not working for me.
  3. Hello experts, I am running with an app and i have some notice error while inserting records. My form code is pasted below: <form action="add_bk_insert.php"> Name <input type="text" name="name"/><br /> E-mail <input type="text" name="email" /><br /> Contact <input type="text" name="contact" /><br /> Requirement <input type="text" name="requirement" /><br /> <input type="submit" value="Submit" /> </form> and my add_bk_insert.php code is as shown below: <?php mysql_connect("localhost","root",""); mysql_select_db("test"); $order = "INSERT INTO sal2 (name,email_id, contact,requirement) VALUES ('$_POST[name]','$_POST[email_id]','$_POST[contact]','$_POST[requirement]')"; $result = mysql_query($order); if($result){ echo "Inserted"; //include_once("testimonials.php"); } else{ echo("<br>Input data is fail"); } ?> when i run the above code it shows a notice error as below: Notice: Undefined index: name Notice: Undefined index: email_id Notice: Undefined index: contact Notice: Undefined index: requirement So i dont know what exactly i am missing. Please some one can help me out with this. I am really stuck.
  4. Yes, you are exactly right. I tried it and it works perfect. But i have use some css "quotes" design in each of records. My css designed code are been pasted below: <?php $con=mysqli_connect("localhost","root","","test"); if (mysqli_connect_errno()) { echo "Failed to connect to MySQL: " . mysqli_connect_error(); } $result = mysqli_query($con,"SELECT * FROM testing where flag=1 "); foreach ($result as $results){ echo "<div class=\"testimonial\">"; while($row = mysqli_fetch_array($results, MYSQL_BOTH)) { echo $row['review'] ; echo "<div class=\"arrow-down\">"; echo "</div>"; echo "<div class=\"testimonial-author\">"; echo $row['name'] ; echo "</div>"; } echo "</div>"."<br>"; } mysqli_close($con); ?> So, now what am i missing... I am really stuck.
  5. Hello Experts, I am stuck in database query. Well i am making a page which retrieve my database value. Below is my code: <?php $con=mysqli_connect("localhost","root","","test"); if (mysqli_connect_errno()) { echo "Failed to connect to MySQL: " . mysqli_connect_error(); } $result = mysqli_query($con,"SELECT * FROM testing where flag=1 "); foreach ($result as $results){ while($row = mysqli_fetch_array($results)) { echo $row['review'] ; echo $row['name'] ; } } mysqli_close($con); ?> When i run the above code it shows me error: Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, array given in /home/stradsol/public_html/test1.php on line 14 I am stuck. I dont know what I am missing. Any help is appreciated.
×
×
  • 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.