Jump to content

benanamen

Members
  • Posts

    2,134
  • Joined

  • Last visited

  • Days Won

    42

Everything posted by benanamen

  1. As @QuickOldCar said, you need to validate/check your data first.
  2. Try this: if($adminString == "False"){ die(header("Location: /path_to_file/error.php")); } Another thing you could do is just redirect them back to your main page and not even show an error to the user.
  3. I was on my phone when I first read your post so I didn't notice the parenthesis making up the Javascript. @mac_gyver has given you what you need for the JS output.
  4. The problem with your code for starters as a you're using obsolete code that will not work in the latest version of PHP. You need to use PDO or mysqli. The second problem is you're creating your own problem. Just echo out the full string you want without creating all those variables with the commas. That sure doesn't look like javaScript.
  5. While that is good and sound advice, it should also be pointed out that those functions require Php version >=5.5.0 Many web hosts are only running versions 5.3.x or 5.4.x if the are even that current.
  6. Ok, heres the real deal that I got from another forum site. She is using a handheld scanner to scan barcodes on books and putting all the scan data into one text box. No details on the scanner. Pretty sure their is a better option for the scanner output then dumping it all to one textarea.
  7. Here is your guidance, go to http://www.w3schools.com/ and study the tutorials. If you get stuck on something we will be happy to help when we see what you have attempted. Your not quite ready for us.
  8. You are not able to get private messages on this site yet. If you want help, all you have to do is provide what was asked for. Your code and your form and preferably an SQL dump of your database.
  9. The reason why is you NEVER store more than one value in a column. It is beyond a recommendation or an opinion, it is the way it needs to be done. PERIOD. Kinda like you drive cars from the front seat, not the back seat. Its just the way its done. Also, study up on database normalization.
  10. This is the "real" answer.
  11. Since you are not providing what I asked for, you are now on your own as far as I go. You come here asking for FREE help and wont provide what is asked of you.
  12. No. Attach a zip of ALL your files and an sql dump of your DB so we can handle this once and for all. It doesnt matter about Android. AND STOP MAKING NEW THREADS
  13. @mac_gyver, to the second part, the query he now has already gives him the the highest single id. He just needs to output the result. SELECT image FROM test_image ORDER BY id DESC LIMIT 1
  14. echo "<img src=\"<?= {$row['image']} ?>\">";
  15. I think your missing the most basic of basic coding. mysqli_fetch_all() Fetches all result rows as an associative array, a numeric array, or both mysqli_fetch_array() Fetches a result row as an associative, a numeric array, or both mysqli_fetch_assoc() Fetches a result row as an associative array Your still better off using PDO.
  16. The coding you have is obsolete and will not work at all in the latest version of Php. You need to us PDO or Mysqli. Besides that, your flow is a mess. Why are you checking the login info twice?
  17. If you want the best answer for your situation, post your code and form.
  18. The problem is your missing value=" " (I think that's what @Barand was pointing out.) You can also clean up your php by letting Mysql do the uppercase SELECT id,UPPER(name) FROM stud ORDER BY studName ​and by using parenthesis instead of escaping your variables. echo "<option value=\"{$row['id']}\" id=\"dropdown\" >{$row['name']}</option>";
  19. After reading your response 10 times I think I understand your response. If I understand correctly, you are using the exact single DB connect file for multiple apps, not duplicates of that file for every app. If that is the case, you will run into problems when you have different groups of Mysql DB users having different logins (Not app users). Really, each app should be self contained and have its own copy of a DB config file. While it is fine for your own personal use to do it that way, it really shouldn't be used as an example to beginners. To be honest, it's a bit lazy.
  20. Dude, why did you start a whole new thread on the same thing?
  21. You're still using PHP to format your date. Let my SQL do the work.
  22. Actually it doesn't. If the db connection file is included in all your scripts then so will the connection without having to call a function, let alone pass a database name. You set the database name in the connection string for that particular app one time and never touch it again for the rest of your life. The only thing you might ever have to change is the database username and password if you move it somewhere else.
  23. Dude, why are you starting a whole new thread on the same exact thing? You're totally trying to do this wrong and if you provided what I asked for I would show you how to do it. I give up. Attention moderator, this is a duplicate post.
  24. Speechless.
  25. Post your form and your current code. You are definitely going about this all wrong.
×
×
  • 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.