Jump to content


  • Posts

  • Joined

  • Last visited

  • Days Won


ginerjm last won the day on October 13

ginerjm had the most liked content!

1 Follower

About ginerjm

  • Birthday 03/23/1952

Profile Information

  • Gender
  • Location
    Voorheesville NY

Recent Profile Visitors

60,355 profile views

ginerjm's Achievements

Prolific Member

Prolific Member (5/5)




Community Answers

  1. What do you mean? Those are commands that you put into your script to turn on error checking. You don't have to look for them. And it is 'ginerjm' please.
  2. I think your JS would have to select each one after it moves it into list B Or maybe select them all when the submit button is clicked
  3. I have no idea what you are saying in the above statement. Apparently you are doing something in the php.ini file. Are you sure you know what you are doing? As for running php 8 and using a 6 year old book - Sure it will teach you most of php but the newer features won't be covered nor will it tell you what is no longer supported.
  4. Hmmm.. Guess I should have corrected his query when I tried to demo using PDO.. OP - the first query is returning an array which you simply used as a singular value in your 2nd query. That should be $cnt = $num[0]; and then use $cnt in your call to RAND. But - you have to re-think how you are using that SQL RAND function. I think you may want to use the PHP 'rand()' function to generate your number and embed that into an OFFSET clause in your query to get a record at random. Read up on it in the manual.
  5. I'll let you setup your own module to do the pdo connection. But the rest of your script is easy. $q = "SELECT COUNT * FROM $db_table"; $num = $pdo->query($q); $q = "SELECT quote,author FROM quotes ORDER BY RAND($num) LIMIT 1"; if (!$result = $pdo->query($q)) { echo "Error running query"; exit(); } list($quote, $author) = $pdo-fetch(PDO::FETCH_NUM); echo "$quote<BR><BR>"; echo "<i>{$author</i>";
  6. If you are going to learn a new db interface I strongly suggest going all the way to PDO. Much easier and much better than mysqli for sure. And learn how to use CSS instead of the outdated <font> tag. And learn not to use the closing php tag.
  7. And now I see the bad paren..... And - have learned a new way of evaluating conditions.
  8. If that first line of code was in your new book, I'd stop using that book. That code doesn't work in my php 7. Perhaps it is new for php 8, but I doubt it. It uses an OR construct (||) that is part of an if statement usually, not an ordinary assignment statement.
  9. Never seen this done before. Sorry it had to happen to you Barand. Obviously Leon gets no help from me anymore. Perhaps the moderators can remove this kind of player from the forum?
  10. Also - wouldn't it be better to add the random number after the real filename to make it easier to find the file by its original name?
  11. If you have code to show us then show us the code - not a black image! I think you don't have 'img' as the name on your INPUT tag for the 'file'
  12. Do you have error checking enabled and are you displaying the messages? Might help if you trapped for an error on the prepare or the execute as well.
  13. Another good reason to avoid using mixed cases in your php code (and html).
  14. Do you know that the file that you attempted to upload actually got to your server/php? Have you tried to do a move_uploaded_file to create a permanent copy that you can look for afterwards and know that your upload was a success? 10 mins later. I notice that you did NOT use move_uploaded_file to save the upload under the name that you later use to make an attachment. That is your problem. If you had use the tmpname then you would have had a file. I suggest that you use the move function to save the uploaded file into a special folder for such attachments and then attach that newly saved file to your email.
  • 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.