Jump to content

Maq

Administrators
  • Posts

    9,363
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by Maq

  1. You need to use double quotes in the query, not single or the $id variable won't interpolate. $result = mysql_query("select * from `games` where ID = $id");
  2. Add a newline \n $logged_string = $_SERVER['REMOTE_ADDR'] . "|" . date("j M Y g:i a") . "\n";
  3. Change this line to: $emp_id_array = addslashes($_POST['emp_id']);
  4. With the date function: $d = "20090409"; echo date("l, F j, Y", strtotime($d));
  5. Then you should read in the manual for examples and explanations of how to code in OOP: PHP OOP
  6. Go through your code and figure out the logic of why the IF statement is even there. It is then you'll find out the appropriate IF statement.
  7. I don't know your design well enough to give you an answer.
  8. I don't like using mysql_result, I prefer this technique: $sql = "SELECT m_date, m_user FROM rate_members WHERE m_id = '{$en['msg_sender']}'"; $result = msyql_query($sql) or die(mysql_error()); $row = mysql_fetch_array($result); echo "Date=> " . $row['m_date'] . " User=> " . $row['m_user'];
  9. Don't use backticks for the value of $status. Just use single quotes: '$status' And use an or die(msql_error()) at the end of your query call.
  10. Like I said, I believe this if statement is failing because none of the variables are being assigned anything and that's why it's throwing all those errors. Check to make sure this if succeeds by echoing something right below it. if ($checkidholder == $userid) { echo "*** WORKS ***"; //rest of code . . . }
  11. It suppresses error messages.
  12. You know when you assign something to another variable that has "is_numeric()" invoked on it, it will return a boolean. $userid = is_numeric($_SESSION['userid']); ^ That line proably assigns TRUE to $userid. So you may want to check the variable if they're numeric then assign the actually value to the variable. As far as your error I get this line isn't true: if ($checkidholder == '$userid') { because the variables that are used in your input fields don't have values, so this if block never executes.
  13. When you use the double quotes you're breaking out of the string into PHP. The reason I used { } is because in the POST array there are single quotes that would have thrown an error. But, if you don't have single quotes, for example just a regular variable you don't have to use either of these and the variable will still interpolate. i.e. $first = $_POST['client_first_name']; $sel = "SELECT * FROM site_clients WHERE client_first_name = '$first'";
  14. Maq

    Big List

    Sure, this is called pagination. You can find a good tutorial here, Basic Pagination
  15. No, you can temporarily turn them on with these lines of code: ini_set ("display_errors", "1"); error_reporting(E_ALL);
  16. That will return true because $x has been set to something even if it's empty or null. If you want to check if the value of $x is empty then use: empty
  17. isset()
  18. Take out the single quotes from this line, I don't think it's getting past this if statement: if ($checkidholder == $userid) {
  19. With error reporting turned on, like PFMaBiSmAd mentioned, this could have been easily detected. I do agree, it is always the little things... Mark as [sOLVED] please, thanks!
  20. Yeah, try this: if(!empty($song) && !empty($artist)) { Before were were checking the array, we want to check the values from the array, artist & song.
  21. Hmm, not sure. You probably already read this but there's a list of command line parameters that explains what they do in the manual, Using PHP from the Command Line Hope this helps.
  22. It's supposed to be this: $result = mysql_query($query) or die (mysql_error());
  23. Yes, you want to check to make sure they both aren't empty, so use double '&&' for and statements: if(!empty($val) && !empty($key)) {
  24. Where does $checkid come from?
  25. What exactly are you trying to do?
×
×
  • 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.