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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  • Users: gandalf458
  • Content: Threads
  • Order by date
  1. 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 =...
  2. 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 =...
  3. 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 =...
  4. 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
  5. gandalf458

    SEO-friendly URLs and .htaccess

    I have a website with SEO-friendly URLs (for example, contact-us rather than contact-us.php) I have the following commands in my .htaccess file which directs all the pages correctly. RewriteEngine on RewriteRule ^([-A-Za-z0-9]+)$ $1.php [PT,L] I would also like, if possible, to direct...
  6. gandalf458

    Wrinkly trying to get back into Fortran!

    Hi. It has been over 35 years since I wrote my last Fortran program and that was in Fortran IV and on punched cards! I have just installed gfortran (Fortran 95) on my Linux box and have written my first simple program: program f2c2f ! convert degrees C to F and F to C implicit none real :: x...

Part and Inventory Search

Back
Top