Jump to content

Maq

Administrators
  • Posts

    9,363
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by Maq

  1. Could you post the portion of the code?
  2. Hmm, I'm not sure which is best. In my example you may have to check each number one at a time instead of using the whole array. For example loop through the $lot_number array and check each one with the in_array() function. Hope this helps.
  3. Haven't tested this code but I think it should help. It makes an array from the selected field from the lottery table where the user is the current user in the session. Then is uses the in_array() function to check if any lottery numbers are in the $number array. $results = mysql_query("SELECT n1,n2,n3,n4,n5,n6 FROM lottery WHERE user_id = '{$_SESSION['Current_User']}'"); $data = mysql_fetch_array($results); $lot_number = array($data['n1'],$data['n2'],$data['n3'],$data['n4'],$data['n5'],$data['n6']); if(in_array($lot_number, $number) { //all ready has this number } else { //perform operation }
  4. It's much easier for people to help if you have actually attempted to code this project. Because we can look at specific code and give you a solid answer. If you ask this question on any forums you're going to get the same answer. So try it out and give us the code and the errors. Good luck!
  5. Correct me if I'm wrong but this code doesn't make sense: if ($next == trim($check)) { You're saying if $next (next element in array) is equal to a trimmed boolean. So wouldn't $skip always be 0 (false)?
  6. I'm 22 years old about to graduate college with a B.S. in Computer Science.  Need to start looking for a job soon!
  7. You need to join the tables where the Id from the 'Person' table equals the PersonId from the 'FavoriteColor' table. Select Name from the Person and Favorite Color table WHERE p.Id = fc.PersonId (to match the correct person and FavColor) Then loop through and display results. Try it and let me know if you need help.
  8. Do you have any code?
  9. Shouldn't it be w/ french braces? require_once {$docroot}.'rss/rss.inc'
  10. No problem, glad I could help.
  11. Yes, AJAX is unarguably an acronym. Even if pronounced the way it sounds, it should still be spelled with all capitals.
  12. Nice link bobox. I will have to check this out sometime.
  13. Sounds good from a security standpoint but for a user it could be confusing.
  14. You want the directory path to use the lowercase string? mkdir ("/home/dir/dir/ftp/".$user_id."")
  15. No worries. I haven't tested that code but I'm pretty sure it will work.
  16. I take back my last post... Registration and log in work good. What's the point of having a 'user name' and a 'display name'?
  17. Is there a test account?
  18. What do you mean? My code does use $_POST. This code is assuming the user hits 'submit' and the form is submitted to the processing page/script. With $_POST all you do is call the name of the input field. So if you have: Then you would get the submitted information by calling... $user_id = $_POST['NoDoze']; Is this what you're asking or helpful?
  19. How do you want to explode these keywords (commas, spaces, etc.)? I'm assuming spaces cause that's what you have in your example. All you do is take the $var2 and foreach through it. Example: foreach ($var2 as $value) { //Search through table for '$value' } Hope this helps.
  20. $user_id = $_POST['user_id']; $user_id = strtolower($user_id);
  21. First you need to set up a Cron Job. After that, assign a script to that Cron that dumps your database into an .sql file and then copies the .sql file back to the other database.
  22. I like the site. I have to agree that the header is too big IMO. But if this is just your personal blog than who cares... I love the auto-scrolling, allows me to be lazy. But isn't that what technology and high level languages are for?
  23. Thanks The Little Guy. This, yet again, confirms the concept of the ?: ternary operator for me. Is there a name for this type of ternary operation?
  24. Hey sorry effigy, I only looked at the Comparison Operators table (obviously) and didn't think it was there. I see what you mean Mchl. Just like in my example, you're assigning port to the SERVER_PORT if it exists but if not then assign nothing.
  25. This syntax is not listed in the link provided but I know what it means now. In the example that I gave it means: If there is a port $port = $_SERVER["SERVER_PORT"]; If there isn't a port then $port = ''; Correct me if I'm wrong but, this is just a shortcut for IF/ELSE statement. Thanks
×
×
  • 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.