Jump to content

Frankice

Members
  • Posts

    17
  • Joined

  • Last visited

Everything posted by Frankice

  1. I'm happy to find this forum, the database have been updated after I removed the email field in the database .Thank you so much I appreciate your time.
  2. I understand your point on the hiring aspect. Here is my connection Sir, <?php // database connection config $dbHost = 'localhost'; $dbUser = ''; $dbPass = ''; $dbName = ''; $dbConn = mysqli_connect ($dbHost, $dbUser, $dbPass) or die ('MySQL connect failed. ' . mysql_error()); mysqli_select_db($dbConn,$dbName) or die('Cannot select database. ' . mysqli_error()); function dbQuery($sql) { $result = mysqli_query($dbConn,$sql) or die(mysql_error()); return $result; } ?>
  3. Please Please can you add the mysqli_error to my code here if (isset($_POST['submit'])){ $date = $_POST['date']; $location = $_POST['location']; $time = $_POST['time']; $track = $_POST['track']; $activity = $_POST['activity']; $details = $_POST['details']; { $query = "INSERT INTO package(date,location,time,track_code,activity,details)VALUES('$date','$location','$time','$track','$activity','$details')"; $check = mysqli_query($dbConn,$query); if($check) { header('location:success_package'); exit; } else { $error = '<div class="alert-warning" style="height:60px;"> <p style="line-height:40px;">Error in posting</p> </div>'; } } }
  4. Please Can I send you link to the website I'm building Sir?
  5. When I submit the form it goes to the $error instead of success and it doesn't update in the database.
  6. Thank you, I showed the full part incase is needed my problem is to insert the datas on the database. Is still giving me error Sir.
  7. Thank you sir, Here is the place I'm having issue.
  8. Okay Sir, I'm still a newbie. I'm trying it out now, so much thanks for your concern.
  9. Please what can I do, I'm stumped? Is there any way you can help me fix it Sir?
  10. Sir, I just want my data to submit to the database. Please why can't the code submit the data the database?
  11. Thank you sir, for now I'm concerning for the code to work properly like submitting the data to my database. My other file adding user works fine but this file having almost the same code is not submitting just giving me this error. Notice: Undefined variable: error in /home/psdelive/public_html/admin/add package.php on line 118 Sir, I can give you the link to help me look into it.
  12. <?php include('../connection.php'); session_start(); if (isset($_POST['submit'])){ $date = $_POST['date']; $location = $_POST['location']; $time = $_POST['time']; $track = $_POST['track']; $activity = $_POST['activity']; $details = $_POST['details']; { $query = "INSERT INTO package(date,location,time,track_code,activity,details)VALUES('$date','$location','$time','$track','$activity','$details')"; $check = mysqli_query($dbConn,$query); if($check) { header('location:success_package'); } else { $error = '<div class="alert-warning" style="height:60px;"> <p style="line-height:40px;">Error in posting</p> </div>'; } } } $sele = "SELECT * from details"; $query = mysqli_query($dbConn,$sele); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Add Package</title> <link type="text/css" rel="stylesheet" href="bootstrap-3.3.7-dist/bootstrap-3.3.7-dist/css/bootstrap.css" /> <link type="text/css" rel="stylesheet" href="bootstrap-3.3.7-dist/bootstrap-3.3.7-dist/css/bootstrap.min.css" /> <link type="text/css" rel="stylesheet" href="bootstrap-3.3.7-dist/bootstrap-3.3.7-dist/css/bootstrap-theme.css" /> <link type="text/css" rel="stylesheet" href="bootstrap-3.3.7-dist/bootstrap-3.3.7-dist/css/bootstrap-theme.min.css" /> <script src="bootstrap-3.3.7-dist/bootstrap-3.3.7-dist/js/bootstrap.js"></script> <script src="bootstrap-3.3.7-dist/bootstrap-3.3.7-dist/js/bootstrap.min.js"></script> <script src="bootstrap-3.3.7-dist/bootstrap-3.3.7-dist/js/npm.js"></script> </head> <style> body { background:#EEE; } </style> <body> <div class="container-fluid" style="background:green; height:70px;"> </div> <div class="container-fluid" style=" min-height:500px;"> <div class="row" style=" min-height:80px;"> <div class="col-lg-2" style="background:gray; height:1100px;"> <a class="btn btn-success" style="width:100%; margin-top:20px;" href="dashboard">Dashboard</a> <a class="btn btn-success" style="width:100%; margin-top:20px;" href="add user">Add Users</a> <a class="btn btn-success" style="width:100%; margin-top:20px;" href="add package">Add Packages</a> <a class="btn btn-success" style="width:100%; margin-top:20px;" href="all packages">View Packages</a> <a class="btn btn-success" style="width:100%; margin-top:20px;" href="send">Send Mail</a> <a class="btn btn-success" style="width:100%; margin-top:20px;" href="logout">Logout</a> </div> <div class="col-lg-10" style="background:#EEE; height:670px;"> <?php echo $error;\\this is the line I'm having issue with ?> <div class="container" style=" margin-top:60px;background:white; box-shadow:5px 5px 5px gray; width:60%;"> <form class="" action="add package.php" method="post"> <div class="form-group"> <label>Track Number</label> <select class="form-control" name="track"> <?php while($row = mysqli_fetch_array($query)) { ?> <option><?php echo $row['track_code']; ?></option> <?php } ?> </select> </div> <div class="form-group"> <label>Date</label> <input type="text" class="form-control" name="date" style="height:40px;" placeholder="Date" /> </div> <div class="form-group"> <label>Time</label> <input type="text" class="form-control" name="time" style="height:40px;" placeholder="Time" /> </div> <div class="form-group"> <label>Activity</label> <input type="text" class="form-control" name="activity" style="height:40px;" placeholder="Activity" /> </div> <div class="form-group"> <label>Location</label> <input type="text" class="form-control" name="location" style="height:40px;" placeholder="Location" /> </div> <div class="form-group"> <label>Details</label> <input type="text" class="form-control" name="details" style="height:40px;" placeholder="Details" /> </div> <div class="container" style=" width:30%; margin-bottom:20px;"> <input class="btn btn-success" style="width:100%;" type="submit" name="submit" value="Save" /> </div> </form> </div> </div> </div> </div> </body> </html> I'm facing database submission issues, please can someone with a good heart help me. Below is my code I don't know what I did wrong it won't submit mydata to the database it gives me error. Notice: Undefined variable: error in /home/psdelive/public_html/admin/add package.php on line 118
  13. I'm facing database submission issues, please can someone with a good heart help me. Below is my code I don't know what I did wrong it won't submit mydata to the database it gives me error. Notice: Undefined variable: error in /home/psdelive/public_html/admin/add package.php on line 118 <?php include('../connection.php'); session_start(); if (isset($_POST['submit'])){ $date = $_POST['date']; $location = $_POST['location']; $time = $_POST['time']; $track = $_POST['track']; $activity = $_POST['activity']; $details = $_POST['details']; { $query = "INSERT INTO package(date,location,time,track_code,activity,details)VALUES('$date','$location','$time','$track','$activity','$details')"; $check = mysqli_query($dbConn,$query); if($check) { header('location:success_package'); } else { $error = '<div class="alert-warning" style="height:60px;"> <p style="line-height:40px;">Error in posting</p> </div>'; } } } $sele = "SELECT * from details"; $query = mysqli_query($dbConn,$sele); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Add Package</title> <link type="text/css" rel="stylesheet" href="bootstrap-3.3.7-dist/bootstrap-3.3.7-dist/css/bootstrap.css" /> <link type="text/css" rel="stylesheet" href="bootstrap-3.3.7-dist/bootstrap-3.3.7-dist/css/bootstrap.min.css" /> <link type="text/css" rel="stylesheet" href="bootstrap-3.3.7-dist/bootstrap-3.3.7-dist/css/bootstrap-theme.css" /> <link type="text/css" rel="stylesheet" href="bootstrap-3.3.7-dist/bootstrap-3.3.7-dist/css/bootstrap-theme.min.css" /> <script src="bootstrap-3.3.7-dist/bootstrap-3.3.7-dist/js/bootstrap.js"></script> <script src="bootstrap-3.3.7-dist/bootstrap-3.3.7-dist/js/bootstrap.min.js"></script> <script src="bootstrap-3.3.7-dist/bootstrap-3.3.7-dist/js/npm.js"></script> </head> <style> body { background:#EEE; } </style> <body> <div class="container-fluid" style="background:green; height:70px;"> </div> <div class="container-fluid" style=" min-height:500px;"> <div class="row" style=" min-height:80px;"> <div class="col-lg-2" style="background:gray; height:1100px;"> <a class="btn btn-success" style="width:100%; margin-top:20px;" href="dashboard">Dashboard</a> <a class="btn btn-success" style="width:100%; margin-top:20px;" href="add user">Add Users</a> <a class="btn btn-success" style="width:100%; margin-top:20px;" href="add package">Add Packages</a> <a class="btn btn-success" style="width:100%; margin-top:20px;" href="all packages">View Packages</a> <a class="btn btn-success" style="width:100%; margin-top:20px;" href="send">Send Mail</a> <a class="btn btn-success" style="width:100%; margin-top:20px;" href="logout">Logout</a> </div> <div class="col-lg-10" style="background:#EEE; height:670px;"> <?php echo $error; ?> <div class="container" style=" margin-top:60px;background:white; box-shadow:5px 5px 5px gray; width:60%;"> <form class="" action="add package.php" method="post"> <div class="form-group"> <label>Track Number</label> <select class="form-control" name="track"> <?php while($row = mysqli_fetch_array($query)) { ?> <option><?php echo $row['track_code']; ?></option> <?php } ?> </select> </div> <div class="form-group"> <label>Date</label> <input type="text" class="form-control" name="date" style="height:40px;" placeholder="Date" /> </div> <div class="form-group"> <label>Time</label> <input type="text" class="form-control" name="time" style="height:40px;" placeholder="Time" /> </div> <div class="form-group"> <label>Activity</label> <input type="text" class="form-control" name="activity" style="height:40px;" placeholder="Activity" /> </div> <div class="form-group"> <label>Location</label> <input type="text" class="form-control" name="location" style="height:40px;" placeholder="Location" /> </div> <div class="form-group"> <label>Details</label> <input type="text" class="form-control" name="details" style="height:40px;" placeholder="Details" /> </div> <div class="container" style=" width:30%; margin-bottom:20px;"> <input class="btn btn-success" style="width:100%;" type="submit" name="submit" value="Save" /> </div> </form> </div> </div> </div> </div> </body> </html>
×
×
  • 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.