Jump to content

Jragon

Members
  • Posts

    148
  • Joined

  • Last visited

  • Days Won

    1

Jragon last won the day on April 27 2017

Jragon had the most liked content!

About Jragon

  • Birthday 01/10/1998

Contact Methods

  • Website URL
    http://jragon.co.uk

Profile Information

  • Gender
    Male
  • Location
    C:\WINDOWS\system32\Jragon.dll

Jragon's Achievements

Regular Member

Regular Member (3/5)

12

Reputation

  1. Hey, I recently wrote a php framework, it's more just a structure for code. https://github.com/Jragon/Midget-MVC It's called Midget-MVC 'cause it's so tiny. I was just wondering what you php experts thought about it. -Jragon
  2. Hi! I'm trying to filter posts... E.G. $post = post from database; $newpost = filter($post); //insert $newpost in place of $post How can I do this? thanks Jragon
  3. <form action="" method="POST"> Product name: <input type="text" name="product" /> Catagory: <select name="cat"> <?php $query = "SELECT id, catagory FROM `catagorys`"; $result = mysql_query($query) or die(mysql_error()); while($row = mysql_fetch_row($result)){ echo "<option value=\"$row[0]\">$row[1]</option>"; } ?> </select><br /> At stores: <?php $query = "SELECT id,short FROM `stores`"; $result = mysql_query($query) or die(mysql_error()); while($row = mysql_fetch_row($result)){ echo "<input type=\"checkbox\" name=\"store\" value=\"$row[0]\" />$row[1]<br />"; } ?> Price:<input type="text" name="price" /> <input type="submit" value="Submit" /> </form> <?php $query = 'SELECT products.product, catagorys.catagory, price.price, stores.short, price.pid, products.id FROM `products` JOIN `catagorys` ON products.cid = catagorys.id JOIN `price` ON price.pid = products.id JOIN `stores` ON price.sid = stores.id;'; $result = mysql_query($query) or die(mysql_error()); $rows = mysql_num_rows($result) or die(mysql_error()); $ppid = ""; while($row = mysql_fetch_row($result)){ if($ppid != $row[4]){ $ppid = $row[4]; echo <<<_ENDHTML Product: $row[0] <br /> Catagory: $row[1]<br /> _ENDHTML; $query = "SELECT price.price, stores.short, price.pid, products.id FROM `products` JOIN `price` ON price.pid = products.id JOIN `stores` ON price.sid = stores.id WHERE products.id = '$row[5]'"; $result = mysql_query($query) or die(mysql_error()); while($row = mysql_fetch_array($result)){ echo "$$row[0] at $row[1]<br />"; } echo <<<_ENDHTML <form action="" method="post"> <input type="hidden" name="delete" value="yes" /> <input type="hidden" name="product" value="$row[0]" /> <input type="hidden" name="price" value="$row[2]" /> <input type="hidden" name="store" value="$row[3]" /> <input type="hidden" name="cat" value="$row[1]" /> <input type="hidden" name="pid" value="$row[4]" /> <input type="submit" value="DELETE RECORD" /></form> </form> _ENDHTML; }elseif($ppid == $row[4]){ echo "<br />$row[2] at $row[3]"; } } From line 28
  4. Okay! So... I can insert... But only one result is showing up in the bit below the form :S
  5. Awesome! Thanks guys! That's the display problems fixed. But now, I can't seem to insert stuff :S <?php require_once('connect.php'); include('functions.php'); if(isset($_POST['product']) && isset($_POST['cat']) && isset($_POST['store']) && isset($_POST['price'])){ $product = escape('product'); $cat = escape('cat'); $store = escape('store'); $price = escape('price'); if (isset($_POST['delete']) && $product != ""){ $pid = escape('pid'); $query = "DELETE FROM `products` where product='$product' DELETE FROM `prices` when pid='$pid'"; mysql_query($query) or die(mysql_error()); }else{ $query = "INSERT INTO `product` VALUES(null, '$cat', '$product')"; mysql_query($query); $query = "SELECT id FROM products WHERE product='$product'"; $result = mysql_query($query) or die(mysql_error()); $row = mysql_fetch_array($result); $pid = $row[0]; $query = "INSERT INTO `price` VALUES('$pid', '$store', '$price')"; } mysql_query($query); } ?> <form action="" method="POST"> Product name: <input type="text" name="product" /> Catagory: <select name="cat"> <?php $query = "SELECT id, catagory FROM `catagorys`"; $result = mysql_query($query) or die(mysql_error()); while($row = mysql_fetch_row($result)){ echo "<option value=\"$row[0]\">$row[1]</option>"; } ?> </select><br /> At stores: <?php $query = "SELECT id,short FROM `stores`"; $result = mysql_query($query) or die(mysql_error()); while($row = mysql_fetch_row($result)){ echo "<input type=\"checkbox\" name=\"store\" value=\"$row[0]\" />$row[1]<br />"; } ?> Price:<input type="text" name="price" /> <input type="submit" value="Submit" /> </form> <?php $query = 'SELECT products.product, catagorys.catagory, price.price, stores.short, price.pid, products.id FROM `products` JOIN `catagorys` ON products.cid = catagorys.id JOIN `price` ON price.pid = products.id JOIN `stores` ON price.sid = stores.id;'; $result = mysql_query($query) or die(mysql_error()); $rows = mysql_num_rows($result) or die(mysql_error()); $ppid = ""; while($row = mysql_fetch_row($result)){ if($ppid != $row[4]){ $ppid = $row[4]; echo <<<_ENDHTML Product: $row[0] <br /> Catagory: $row[1]<br /> _ENDHTML; $query = "SELECT price.price, stores.short, price.pid, products.id FROM `products` JOIN `price` ON price.pid = products.id JOIN `stores` ON price.sid = stores.id WHERE products.id = '$row[5]'"; $result = mysql_query($query) or die(mysql_error()); while($row = mysql_fetch_array($result)){ echo "$$row[0] at $row[1]<br />"; } echo <<<_ENDHTML <form action="" method="post"> <input type="hidden" name="delete" value="yes" /> <input type="hidden" name="product" value="$row[0]" /> <input type="hidden" name="price" value="$row[2]" /> <input type="hidden" name="store" value="$row[3]" /> <input type="hidden" name="cat" value="$row[1]" /> <input type="hidden" name="pid" value="$row[4]" /> <input type="submit" value="DELETE RECORD" /></form> </form> _ENDHTML; }elseif($ppid == $row[4]){ echo "<br />$row[2] at $row[3]"; } } ?> I have no idea what I've done wrong.
  6. Hi! When I execute my code, I get: 1iPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at HTCiPhone 4 at Over and over again What I need it to be like: Product: iPhone 4 Catagory: HTC 400$ at store 1 412$ aat store 2 ect. [button]DELTE RECORD Here is my php code: <?php require_once('connect.php'); include('functions.php'); if(isset($_POST['product']) && isset($_POST['cat']) && isset($_POST['store']) && isset($_POST['price'])){ $product = escape('product'); $cat = escape('cat'); $store = escape('store'); $price = escape('price'); $pid = escape('pid'); if (isset($_POST['delete']) && $product != "" && $pid != ""){ $query = "DELETE FROM `products` where product='$product' DELETE FROM `prices` when pid='$pid'"; mysql_query($query) or die(mysql_error()); }else{ $query = "INSERT INTO `product` VALUES(null, '$cat', '$prouct')"; mysql_query($query); $query = "SELECT id FROM product WHERE catagory='$cat' product='$product'"; while(mysql_fetch_row(mysql_query($query))){ $pid = $row[0]; } $query = "INSERT INTO `price` VALUES('$pid', '$store', '$price')"; } mysql_query($query); } ?> <form action="" method="POST"> Product name: <input type="text" name="product" /> Catagory: <select name="cat"> <?php $query = "SELECT id, catagory FROM `catagory`"; $result = mysql_query($query); while($row = mysql_fetch_row($result)){ echo "<option value=\"$row[0]\">$row[1]</option>"; } ?> </select><br /> At stores: <?php $query = "SELECT id,short FROM `stores`"; $result = mysql_query($query) or die(mysql_error()); while(mysql_fetch_row($result)){ echo "<input type=\"checkbox\" name=\"store\" value=\"$row[0]\" />$row[1]<br />"; } ?> Price:<input type="text" name="price" /> </form> <?php $query = 'SELECT products.product, catagorys.catagory, price.price, stores.short, price.pid, products.id FROM `products` JOIN `catagorys` ON products.cid = catagorys.id JOIN `price` ON price.pid = products.id JOIN `stores` ON price.sid = stores.id;'; $result = mysql_query($query) or die(mysql_error()); $rows = mysql_num_rows($result) or die(mysql_error()); $ppid = ""; while($row = mysql_fetch_row($result)){ if($ppid != $row[4]){ $ppid = $row[4]; echo <<<_ENDHTML Product: $row[0] <br /> Catagory: $row[1]<br /> _ENDHTML; $query = "SELECT price.price, stores.short, price.pid, products.id FROM `products` JOIN `price` ON price.pid = products.id JOIN `stores` ON price.sid = stores.id WHERE products.id = '$row[5]'"; echo $row[5]; $result = mysql_query($query) or die(mysql_error()); while(mysql_num_rows($result)){ echo "$row[0] at $row[1]"; } echo <<<_ENDHTML <form action="" method="post"> <input type="hidden" name="delete" value="yes" /> <input type="hidden" name="product" value="$row[0]" /> <input type="hidden" name="price" value="$row[2]" /> <input type="hidden" name="store" value="$row[3]" /> <input type="hidden" name="cat" value="$row[1]" /> <input type="hidden" name="pid" value="$row[4]" /> <input type="submit" value="DELETE RECORD" /></form> </form> _ENDHTML; }elseif($ppid == $row[4]){ echo "<br />$row[2] at $row[3]"; } } ?> Here is my database dump: -- phpMyAdmin SQL Dump -- version 3.3.9 -- http://www.phpmyadmin.net -- -- Host: localhost -- Generation Time: Aug 17, 2011 at 11:12 PM -- Server version: 5.5.8 -- PHP Version: 5.3.5 SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; -- -- Database: `pos` -- -- -------------------------------------------------------- -- -- Table structure for table `catagorys` -- CREATE TABLE IF NOT EXISTS `catagorys` ( `id` int(11) NOT NULL AUTO_INCREMENT, `catagory` varchar(255) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ; -- -- Dumping data for table `catagorys` -- INSERT INTO `catagorys` (`id`, `catagory`) VALUES (1, 'HTC'), (2, 'iPhone'); -- -------------------------------------------------------- -- -- Table structure for table `employees` -- CREATE TABLE IF NOT EXISTS `employees` ( `id` int(11) NOT NULL AUTO_INCREMENT, `sid` int(11) NOT NULL, `fname` varchar(255) NOT NULL, `lname` varchar(255) NOT NULL, `pass` int(11) NOT NULL, `hours` int(11) NOT NULL, `clocked` tinyint(1) NOT NULL, `wage` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ; -- -- Dumping data for table `employees` -- INSERT INTO `employees` (`id`, `sid`, `fname`, `lname`, `pass`, `hours`, `clocked`, `wage`) VALUES (1, 1, 'Rory', 'Anderson', 123456, 1, 0, 50), (2, 1, 'Phil', 'Brown', 1337, 0, 0, 15); -- -------------------------------------------------------- -- -- Table structure for table `price` -- CREATE TABLE IF NOT EXISTS `price` ( `pid` int(11) NOT NULL, `sid` int(11) NOT NULL, `price` int(11) NOT NULL, PRIMARY KEY (`pid`,`sid`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `price` -- INSERT INTO `price` (`pid`, `sid`, `price`) VALUES (1, 31, 112), (1, 32, 60000); -- -------------------------------------------------------- -- -- Table structure for table `products` -- CREATE TABLE IF NOT EXISTS `products` ( `id` int(11) NOT NULL AUTO_INCREMENT, `cid` int(11) NOT NULL, `product` varchar(255) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ; -- -- Dumping data for table `products` -- INSERT INTO `products` (`id`, `cid`, `product`) VALUES (1, 1, 'iPhone 4'); -- -------------------------------------------------------- -- -- Table structure for table `sales` -- CREATE TABLE IF NOT EXISTS `sales` ( `id` int(11) NOT NULL AUTO_INCREMENT, `eid` int(11) NOT NULL, `pid` int(11) NOT NULL, `sold` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; -- -- Dumping data for table `sales` -- -- -------------------------------------------------------- -- -- Table structure for table `stores` -- CREATE TABLE IF NOT EXISTS `stores` ( `id` int(11) NOT NULL AUTO_INCREMENT, `address` varchar(255) NOT NULL, `state` varchar(255) NOT NULL, `phone` varchar(255) NOT NULL, `tax` int(11) NOT NULL, `short` varchar(255) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=33 ; -- -- Dumping data for table `stores` -- INSERT INTO `stores` (`id`, `address`, `state`, `phone`, `tax`, `short`) VALUES (31, 'Here', '100', '100000', 10, 'here'), (32, 'There', '101', '1000001', 111, 'there'); -- -------------------------------------------------------- -- -- Table structure for table `tills` -- CREATE TABLE IF NOT EXISTS `tills` ( `id` int(11) NOT NULL AUTO_INCREMENT, `sid` int(11) NOT NULL, `eid` int(11) NOT NULL, `open` int(11) NOT NULL, `cash` int(11) NOT NULL, PRIMARY KEY (`id`,`sid`,`eid`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; -- -- Dumping data for table `tills` -- I don't have a clue how I can get this to work Thanks JRagon
  7. So, I need to make a little form, that has the names of all the articles. With check boxes next to the name. When submitted it sends through the checked title names. Then it it gets the articles from using the titles. After that it runs the articles through my filter, and updates the articles. How on earth would I do this :S I've got good knowladge of PHP, but not so much of WordPress I don't have a clue how I could create a plugin like that.
  8. Hi! I just installed a LAMP server for Ubuntu, and well, it isn't show me errors.... Nothing! Which makes development rather hard... How can I turn errors on, in php.ini? Thanks Jragon
  9. QuickOldCar, do you know of a way to start at 50, and go another 50?
  10. Oh, D: Is there anyway to store upto 50 results then carry on after 50 and do another 50?
  11. Hi! I'm trying to use the bing API thingy to search through a few results.... I can search 50 results but any higher and it gives me: PHP Notice: Undefined variable: returnValue in /var/www/lib/Msft/Bing/Search.php on line 738 PHP Notice: Undefined property: stdClass::$Web in /var/www/lib/bing.php on line 68 PHP Notice: Trying to get property of non-object in /var/www/lib/bing.php on line 68 PHP Warning: Invalid argument supplied for foreach() in /var/www/lib/bing.php on line 68 My code is: function __autoload($className) { $fileName = strtr($className,'_',DIRECTORY_SEPARATOR).".php"; include $fileName; return; } $apiKey = '0291518CA7B6C789903D60F8AEB4CD30194F1F07'; //$search = $_GET['search']; //if(isset($_GET['search'])){ $o = new Msft_Bing_Search($apiKey); $o->setQuery('photography') ->setSource('Web'); $raw = $o->search(); $result = json_decode($raw); foreach($result->SearchResponse->Web->Results as $value) { $feed = locateFeedUrl($value->Url); $fh = fopen('feeds.txt', 'a'); fwrite($fh, $feed . "\n"); } //}
  12. Fatal error: Cannot redeclare getparsedhost() (previously declared in /hermes/bosweb/web199/b1999/ipg.jragoncouk/jragon/lib/bing.php:10) in /hermes/bosweb/web199/b1999/ipg.jragoncouk/jragon/lib/bing.php on line 10 I can't see why it is doing that... Maybe becuase it's a function inside of a function...
  13. Take a look at: http://jragon.co.uk/lib/bing.php?search=cake You'll be able to see the errors, and the first 2 results, that are from wikipedia..
  14. Aha! That's very very useful! I'm now trying to omit all /w/index files because, that is the Wikipedia thing, and well, I don't really want it... I've tried if(!preg_match('/w/index.php', $match, $rssUrl)) That didn't work...
×
×
  • 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.