note 108858 added to language.functions

From: Date: Wed, 30 May 2012 21:38:41 +0000
Subject: note 108858 added to language.functions
Groups: php.notes 
Request: Send a blank email to php-notes+get-188305@lists.php.net to get a copy of this message
sample connection to local db with queries and preset functions. <?php $custID = $_POST["custID"]; $shipped = $_POST["shipped"]; ?> <?php $conn = mysql_connect("localhost", "twastudent", "prac3"); mysql_select_db("warehouse", $conn); $sql = "select orderNumber, orderDate, shippingDate, shipped, customer.customerID, firstName, lastName, suburb FROM customer, orders WHERE customer.customerID='$custID' AND shipped='$shipped' ORDER BY orderDate desc"; $rs = mysql_query($sql, $conn) or die ('Problem with query' . mysql_error()); ?> <?php if (mysql_num_rows($rs)>0){ ?> <table border="1" summary="Product Information"> <tr> <th>Order Number</th> <th>Order Date</th> <th>Shipping Date</th> <th>Customer ID</th> <th>First Name</th> <th>Last Name</th> <th>Suburb</th> </tr> <?php while ($row = mysql_fetch_array($rs)) { ?> <?php while ($row = mysql_fetch_array($rs)) { ?> <tr> <td><a href="view.php?<?php echo $row["orderNumber"]?>"><?php echo $row["orderNumber"]?></a></td> <td><?php echo $row["orderDate"]?></td> <td><?php echo $row["shippingDate"]?></td> <td><?php echo $row["customerID"]?></td> <td><?php echo $row["firstName"]?></td> <td><?php echo $row["lastName"]?></td> <td><?php echo $row["suburb"]?></td> </tr> <?php } mysql_close($conn); ?> <?php } ?></table> <?php } else {?> <p>The customer identity does NOT exist!</p> <?php } ?> ---- Server IP: 69.147.83.197 Probable Submitter: 122.106.54.18 ---- Manual Page -- http://www.php.net/manual/en/language.functions.php Edit -- https://master.php.net/note/edit/108858 Del: integrated -- https://master.php.net/note/delete/108858/integrated Del: useless -- https://master.php.net/note/delete/108858/useless Del: bad code -- https://master.php.net/note/delete/108858/bad+code Del: spam -- https://master.php.net/note/delete/108858/spam Del: non-english -- https://master.php.net/note/delete/108858/non-english Del: in docs -- https://master.php.net/note/delete/108858/in+docs Del: other reasons-- https://master.php.net/note/delete/108858 Reject -- https://master.php.net/note/reject/108858 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#188305) next »