Jump to content

Maq

Administrators
  • Posts

    9,363
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by Maq

  1. You can just do: if($en['i_id'] = mysql_result(mysql_query("SELECT i_id FROM rate_pictures WHERE i_status='2' AND i_user='".$en[msg_sender]."'"), 0, "i_id")) { // Proceed } else { // Invalid }
  2. Make sure the name of all your checkbox fields are "pms[]". Like Axeia mentioned, output what's actually in the array, print_r($_POST['pms']); You also need each value to be a string so make sure the final output of your query is similar to: fieldname IN ('US','UK','GB','CN');
  3. Put an @ symbol in front of "mysql_result". If you want to suppress the error why don't you just take out the entire line?
  4. When they log in, do a query that retrieves this information and store it into a SESSION variable. Then when you get to the home page you already have this information.
  5. No, you would probably only see "thank" cause it will get cut off after the space. You need to use urlencode.
  6. EDIT: Nvm doesn't work. Your code works for me with your sample data.
  7. Are you storing the user name/id in a session? (which would be a good idea if you're not) If so, you can just grab it from there and not even query the database.
  8. Count and check to make sure you have the matching { } tags.
  9. He said "table structure", which means what are the fields and their types that are in that table, not what tables are in the database.
  10. You don't, you just see if it's what you expect by echoing something directly under it to see if it succeeded. Or, you can echo the two values it's comparing right above it to see if you're using the logical operator correctly.
  11. Do you get any errors? Did you echo out the sql statement to see if it's what you intended? Are you echoing out below the if statements to see if they succeed and proceed to your sql portion?
  12. Change this line and tell me what it outputs: $result = mysql_query($query) or die(msyql_error());
  13. You should use '='. Like is used to match things that are 'like' what you're comparing to, not exact. For example you could use the wildcard '%'. SELECT * FROM table WHERE userid LIKE '1%' This will match anything that begins with a 1 (12, 13, 14 etc...) Hope this helps.
  14. You can also use cURL to post data. This may be the best solution for you.
  15. Looks like you're inserting without even testing to see if the user name exists. You have to do something like: $sql = "SELECT * FROM users WHERE username = '{$_POST['username']}'"; $result = mysql_query($sql) or die(mysql_error()); if(mysql_num_rows($result)) > 0) { // The user name already exists } else { // Proceed with your INSERT code . . . }
  16. No, but the equivalent for windows would be the Task Scheduler. Which would be the same concept and allow you to run scripts every hour. Google it, I'm sure you'll find information on how to set one up.
  17. Never mind, it works now.
  18. You need to submit the form to itself and get the POST variable from the input field. Can we see some relevant code?
  19. After you sign up you should see the download for the different platforms. You should download the gz file locally and FTP it to your site and set it up there. If you just need something simple then SSH to your server and use the command "top" or "ps -ef" to view the details of the current processes.
  20. Nvm, I see where you set $namn. I don't see why my query would show $namn as empty but yours would INSERT it. Can you echo out your query: $laggTill = "INSERT INTO fritidsdagen (id , namn, kurs, first_time, more) VALUES ('$id' ,'$namn', '$kurs', '$first_time', '$more')"; echo "YOUR QUERY=> " . $laggTill;
  21. I prefer using double quotes for the string and single quotes for the attributes. Reason being, it's a good practice if you need variables to interpolate in the string, as generic mentioned.
  22. Try this: RCLI (you need to register) As far as your purposes, it monitors your server and gives you detailed status reports. There are also many other useful features.
  23. I bet your table is empty... You need something like this for all of your POST vars. $namn = (empty($_POST['namn'])) ? "Not set" : $_POST['namn']; Before you weren't assigning anything to $namn if $_POST['namn'] wasn't empty.
  24. Whoops, yeah, you don't need the return= in there. :-X
×
×
  • 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.