Jump to content

Pandemikk

Members
  • Posts

    144
  • Joined

  • Last visited

Contact Methods

  • Website URL
    http://bodybagsent.net

Profile Information

  • Gender
    Not Telling

Pandemikk's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. How do you fix a "file doesn't exist" error? Uhm... You create the file? Why are you trying to include a file that doesn't exist in the first place?
  2. It means the file doesn't exist. Hence: "No such file or directory".
  3. that's because $result doesn't contain the value of your SUM. It contains the array of the selected values, which, in this case, is just one value. sum(price) AS price echo $result['price'];
  4. No. I'm assigning $row['item_quantity'] that value then making sure it isn't 0 so I don't divide by 0. I didn't test it but it should work fine.
  5. That's a big mess. Why are you over complicating it with functions? There's no need for it and it just looks sloppy. And you're getting that error because you're using mysqli_fetch_array on a delete query. Why the #$% are you doing that?
  6. Be sure to escape $_POST['project'] before actually using this script (http://php.net/manual/en/function.mysql-real-escape-string.php). What exactly goes wrong in your script? Does it echo "Project not found"? In that case, a row was not found. You should be using LIMIT 1 since you're doing one redirect. And you should use die; after header to stop code processing. I don't recommend using * to select everything. Just select what you need. <?php include("project_admin/includes/config.php"); $db = new Database($db_host, $db_username, $db_password, $db_database, $db_table_prefix); $db -> connect(); if ($_POST['findproject']{ $q = $db->mysql_query("SELECT * FROM projects WHERE project LIKE '" . mysql_real_escape_string($_POST['project']) . "' LIMIT 1"); if (!$q){ echo "Project Not Found"; }else{ header('Location:' . $r['url']); die; } ?> Use die($_POST['project']); at the top of the script to make sure its value is correct.
  7. I don't recommend you wrap integers in single quotes^. If you are unsure if your variable is an integer you should sanitize it. There's no reason to use LIMIT 1. How could he possibly know he's deleting the right row that way?
  8. Uhm I think I do... http://dev.mysql.com/doc/refman/5.0/en/control-flow-functions.html#function_if SELECT IF(response = 'Yes', COUNT(whatever you're counting), 0)
  9. $query ="SELECT article_id FROM article_updates GROUP BY article_id ORDER BY timestamp_of_update ASC"; Simple group by statement will return all (unique) article_ids with the highest timestamp. For your second question we'll need to see your table information.
  10. Foreign keys to what? I don't think that's even relevant information. Anyway, what you're asking is to delete rows with a user_id of 1, question_id of 7 and answer_id of 3. If a row(s) with all those values exists, it will be deleted.
  11. No it's not. Like he said it only shows in IE which means it most likely has nothing to do with PHP and is something browser specific to IE.
  12. CRON scripts are not something you can do with PHP alone. You need your server to run the CRON scrips for the nth time. If your server does not offer that option, you can emulate it by placing the script to run the emails on pages on the web site. This way, whenever someone hits say index.php your CRON script would execute to see if anything should be sent. This is not very efficient.
×
×
  • 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.