Jump to content

Maq

Administrators
  • Posts

    9,363
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by Maq

  1. Not entirely sure, but I think this should be: FOREIGN KEY (Order_no) because you want to relate Order_no to the Customer_id from the CUSTOMER table.
  2. Yeah, after seeing this thread I actually reported that in the "Forum Upgrade" thread.
  3. 'ORDER' is a reserved word in MySQL. You should choose another database name. http://dev.mysql.com/doc/refman/5.1/en/reserved-words.html
  4. I see what you're trying to do there. Be careful because you're checking if a number is numeric on the PHP side, which is loosely typed, also sometimes you may want to store numerics in a VARCHAR column.
  5. OK, I didn't know your wrap() function just put single quotes around the value. Is there a specific reason you're using that function? Other than that your query looks fine. The only other thing I can suggest is getting rid of the wrap() function and just putting single quotes there manually like the other values.
  6. Can I see what you changed?
  7. Sorry, are you referring to the actual code, or the result of your code?
  8. If your data constitently has the same name prefixing the integers, then you can use something like: ORDER BY SUBSTRING(column_name,5); Otherwise, it will be a bit more complicated.
  9. I'm guessing the value 'Testing' is in the variable $post_vars['m_name']? Can you echo out your $query statement and post it here?
  10. Did you try what I said and use POST instead of GET? The URL you're using to call the page does NOT contain an 'id' variable and your form action is POST, hence the 'undefined variables: id' error.
  11. Can you post the exact error message & the new query?
  12. Get an IDE that has auto-formatting.
  13. I'm going to guess that the value here needs single quotes, like this: m_name = '". wrap($post_vars['m_name']) ."'
  14. In the future, please put tags around your code.
  15. For more information: http://us3.php.net/ternary - Example #2
  16. In the future, please use tags around your code.
  17. FlannelBeard, I deleted your other thread. Do NOT double post, even if it's in 2 different sections.
  18. As betterphp said, this usually means you're missing a terminating '}'. If you properly format/indent your php code then you would probably be able to see where the missing brace occurs.
  19. Yes. @stackumhi - Do not post more than once. You actually triple posted the same exact question. I merged the replies from the other thread here.
  20. This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=328883.0
  21. So do you have a question? (Please be conscious of where you post this is clearly a SQL issue, not PHP Coding)
  22. Your form method is POST so you should be using POST. Change these lines to: if (!isset($_POST['submit'])){ $id = mysql_real_escape_string($_POST['id']); $query = "SELECT * FROM people WHERE ID = $id";
  23. In the future, when posting code please use the around your code.
  24. Does this file exist? /var/run/mysqld/mysqld.sock
  25. Hi and welcome
×
×
  • 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.