Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* query Cutomer Name */
- if($_POST['txtcustomercode'] != '' && $loaded_customer == false){
- $_SESSION['customercode'] = $_POST['txtcustomercode'];
- $loaded_customer = true;
- }
- if($loaded_customer){
- /* connect database */
- /* $mysqli = new mysqli($host, $username, $password, $database); */
- $mysqli = new mysqli("localhost", "root", "cpe332", "ticket");
- $mysqli -> set_charset('utf8'); /* set character */
- /* select customer detail */
- if ($stmt = $mysqli->prepare("SELECT customercodem,name,telephone FROM customer WHERE customercode = ?")) {
- /* bind parameters to '?' */
- /* i = int , d = double and float, b = blob, s = all other types */
- $stmt -> bind_param('s',$_SESSION['customercode']);
- /* execute the prepared statement */
- $stmt -> execute();
- /* Bind results to variables */
- $stmt-> bind_result($customername);
- $stmt-> bind_result($telephone);
- /* fetch values */
- while ($stmt->fetch()) {
- $textbox['customername'] = $customername;
- $textbox['telephone'] = $telephone;
- }
- /* Close the statement */
- $stmt->close();
- $mysqli->close();
- $loaded_customer = false;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement