Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recent content by gandalf458

  1. gandalf458

    Cannot get php to parse

    If you have both Apache and IIS running there may well be some conflict between to two. I'm not a number, I'm a free man
  2. gandalf458

    HTML LINK ON IPHONE

    Not sure how this relates to PHP? I'm not a number, I'm a free man
  3. gandalf458

    Trying to find is a null is True False

    The mysql_* functions were deprecated some years ago and don't even exist in the latest version of PHP. It is better to use mysqli_* or PDO. I'm not a number, I'm a free man
  4. gandalf458

    Newbie Python (CGI) question

    Hi Feheke That's just the kind of feedback I was hoping for. Many thanks I'm not a number, I'm a free man
  5. gandalf458

    Migrate website from PHP 5.3 to 5.5

    There's a migration guide at http://php.net/migration55 for upgrading 5.4 to 5.5 and another for upgrading 5.3 to 5.4. These may help you find what to look for. I'm not a number, I'm a free man
  6. gandalf458

    Newbie Python (CGI) question

    Hi. I'm new to Python, trying to teach myself. I have the following script which works fine but I'm wondering if there are better ways of doing some things. print("Content-type:text/html\r\n") import cgi, cgitb form = cgi.FieldStorage() # Get data from form fields # text fields tname =...
  7. gandalf458

    SELECT single record

    Many thanks for explaining. I'm not a number, I'm a free man
  8. gandalf458

    SELECT single record

    Thanks for your reply. Is using fethcAll() and a foreach loop really more efficient than fetch() and no foreach loop? It sounds counter-intuitive. I'm not a number, I'm a free man
  9. gandalf458

    SELECT single record

    Okay. Dimwit that I am, this seems to do the job: $query = 'SELECT * FROM talks WHERE id=:id;'; $stmt = $db->prepare($query); $stmt->bindValue(':id', $id); $stmt->execute(); $result = $stmt->fetch(); $address = $result['address']; $num_views = $result['num_views']; I'm not a number, I'm a...
  10. gandalf458

    SELECT single record

    I'm using SQLite and I have the following to get a single record: $query = 'SELECT * FROM talks WHERE id=:id;'; $stmt = $db->prepare($query); $stmt->bindValue(':id', $id); $stmt->execute(); $result = $stmt->fetchAll(); foreach ( $result as $row ) { $address = $row['address']; $num_views =...
  11. gandalf458

    Resizing image with same aspect ratio

    Thanks spamjim. I'm not a number, I'm a free man
  12. gandalf458

    Resizing image with same aspect ratio

    I have a script that uploads and if necessary resizes an image. It works fine except that if the uploaded image is not the same aspect ratio as the source image it gets distorted. Can anyone help me work out what I need to add to change the aspect ratio please? $image =...
  13. gandalf458

    SQLite count rows in table

    Great - many thanks. I'm not a number, I'm a free man
  14. gandalf458

    SQLite count rows in table

    I've tried $query = 'SELECT count(*) FROM talks;'; $result = $db->query($query); which I assume is much the same thing? But then I need to get the value out of $result! I'm not a number, I'm a free man
  15. gandalf458

    SQLite count rows in table

    I simply want to count the number of rows in a table. I have: $query = 'SELECT count(*) FROM talks;'; but then how do I get the result of the select? I'm using PDO. Thanks

Part and Inventory Search

Back
Top