Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

webbie1985

Members
  • Joined

  • Last visited

Reputation Activity

  1. Like
    webbie1985 reacted to inlinedivblock in Sorry to keep posting   
    Hi me again
    mysql_real_escape_string(mysql_query("SELECT productdescription FROM products WHERE productcode = '{productcode}'")); May have overdone the mysqlrealescapestring, only really need to use it for inputting data into rows from user inputs. And i don't think you need to encapsualte the whole mysql_query

    Your while loop is incomplete have a quick look at this for while loops http://www.tizag.com/phpT/whileloop.php
     
    As for what you are trying to do you are going to need to use Ajax with Javascript to change values in from input field. This is a good place to start: http://www.w3schools.com/php/php_ajax_php.asp you can adapt the code there to suit your needs.
  2. Like
    webbie1985 reacted to Chris Day in Sorry to keep posting   
    this should work for you:
    <?php include ("db.php"); $prodsearch1 = mysql_real_escape_string($_POST['productcode']); $prodfind = mysql_query("SELECT productdescription FROM products WHERE productcode = '".$prodsearch1."'"); $row5 = mysql_fetch_array($prodfind); $row5 = $row5['productcode']; ?> Any user inputted text going into any query needs to be sanitized
  3. Like
    webbie1985 reacted to Chris Day in Sorry to keep posting   
    put echo mysql_error(); just before the ?>
  4. Like
    webbie1985 reacted to inlinedivblock in Sorry to keep posting   
    are values being posted before you get to the page you have just displayed above? probably why you are not getting any results returned...
  5. Like
    webbie1985 reacted to inlinedivblock in Sorry to keep posting   
    you might just have to post the id from another page or you can post on to itself to retireve the data if you don't want to use ajax!
  6. Like
    webbie1985 reacted to Chris Day in Sorry to keep posting   
    i would remove your DB details ASAP!
  7. Like
    webbie1985 reacted to Chris Day in Sorry to keep posting   
    no problem as for your question, what JQuery plugin are you using as you will have to bind a click event to fill in the data for you or do you have a live link?
  8. Like
    webbie1985 reacted to Chris Day in Sorry to keep posting   
    i get an error while loading jquery
    Failed to load resource: the server responded with a status of 404 (Not Found) http://www.swifttrading.co.uk/pmanagement/jquery/js/jquery-1.4.2.min.js
    Failed to load resource: the server responded with a status of 404 (Not Found) http://www.swifttrading.co.uk/pmanagement/jquery/js/jquery-ui-1.8.2.custom.min.js
  9. Like
    webbie1985 reacted to inlinedivblock in Sorry to keep posting   
    <?php $mysqli = new mysqli(); $text = $mysqli->real_escape_string($_GET['term']); $query = "SELECT * FROM products WHERE productcodes LIKE '%$text%' ORDER BY productcodes ASC"; $result = $mysqli->query($query); while($row = $result->fetch_assoc()) { ?> <script> $("input[type='text'][name='quantity']").keyup(function () { var value = $(this).val('<?php echo $row['qty']?>'); }).keyup(); $("input[type='text'][name='ponumber']").keyup(function () { var value = $(this).val('<?php echo $row['ponumber'] ?> '); }).keyup(); </script> <?php } ?>  
    This is with JQUERY it is the simplest solution i can come up with, it targets the INPUT fields with the relevant name that you have used and fills it in from the results returned on the search. You may want to limit results to 1 on the mysql query,
    $row[''] <--- inside here you need to call the correct fiield name, not sure what you called them in your database, i just guessed
     
    But this should help you understand how to fill it in live?
     
    see it working here in theory http://jsfiddle.net/hdhJw/
  10. Like
    webbie1985 got a reaction from fleur in Best book for learning JQuery   
    i agree with stephenOC but try http://www.codecademy.com it teaches you what you need but you have to complete tasks to progress really good way of learning
  11. Like
    haha no worries, i wasn't going to make big DEAL out of it, as i do it all the time...

    You might want to think about securing the results, as the way it is coded it is open to hacking, someone can actually extract all your data the way you have it.

    Have a look a little read of this http://php.net/manual/en/function.mysql-real-escape-string.php or lookup SQL Injection in google.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.