php - I try upload the user comment into my db. After I click submit, everything looks fine but I look in my db, there are no record. -
php - I try upload the user comment into my db. After I click submit, everything looks fine but I look in my db, there are no record. -
i tried tutorial website.
i seek upload user comment db. after click submit, looks fine in db, there no record.
this php code $dbhost = 'localhost:8090'; $dbuser = 'root'; $dbpass = 'password'; $conn = mysql_connect($dbhost, $dbuser, $dbpass); if( $_post ){ $con = mysql_connect("localhost","root","password"); } if(!$con){ die('could not find db');} mysql_select_db("doctorapp", $con); $ticket_user_fname = $_post['fname']; $ticket_user_lname = $_post['lname']; $ticket_email =$_post['email']; $ticket_hp =$_post['contact_number']; $ticket_content = $_post['content']; $ticket_category = $_post['category']; $query =" insert `ticketing`(`ticket_id`, `fname`, `email`, `content`, `category`, `contact_number`, `lname`) values ('ticket_id','ticket_time','ticket_user_fname','ticket_email','ticket_conetnt','ticket_category','ticket_hp','ticket_lname') "; mysql_query($query); echo "<h3>we rreply possible. give thanks you.</h3>"; mysql_close($con); ?>
i new php. give thanks you!
may forgot set $
before variable
$query =" insert `ticketing`(`ticket_id`, `fname`, `email`, `content`, `category`, `contact_number`, `lname`) values ('$ticket_id','$ticket_time','$ticket_user_fname','$ticket_email','$ticket_content', '$ticket_category','$ticket_hp','$ticket_user_lname') ";
make sure defined $ticket_id
, $ticket_time
before using them , if ticket_id
primary key of table auto increment uniqueness , don't need insert seperately.
php html mysql upload
Comments
Post a Comment