Jump to content

lalnfl

Members
  • Posts

    136
  • Joined

  • Last visited

    Never

Everything posted by lalnfl

  1. When I do this: $matches++; $sql_update_matches = mysql_query("UPDATE Live_Event SET matches='$matches' WHERE id='$show_id' AND promo_id='$promotion_id'"); But when it should update the database from 0 to 1, it update it to U. What is the problem?
  2. Without having to manually reload the page? There isn't anything similar to AJAX?
  3. Is there another way of getting info from the database thats not AJAX?
  4. I have this xmlhttp.open("GET","promotions.php?promotion_id=$promotion_id&show_id=$show_id&add_match="+str,true); And I want to have it where the php $_GET variables can transfer into javascript variables so that I can have the $promotion_id and $show_id in the url. When I run my full script, and there is a form on there that goes to the same page, it shows promotions.php?promotion_id=$promotion_id&show_id=$show_id&add_match, but the $promotion_id and $show_id variables should be numbers, but I don't know how to transfer php GET variables to Javascript? Any help?
  5. This is what happens . What am I doing wrong? Here is an image of what it is turning out like, and this shouldn't happen. if (isset ($_GET['add_match'])){ $match_id = $_GET['add_match']; $sql_match_details = mysql_query("SELECT * FROM Matches WHERE id='$match_id'"); while ($get_match = mysql_fetch_array($sql_match_details)){ $match_name = $get_match['name']; $match_prestige = $get_match['prestige']; $match_content_risk = $get_match['content_risk']; $match_injury_risk = $get_match['injury_risk']; $match_description = $get_match['description']; $result = "$match_name"; } $body = "<div style='width: 300px; float: left'> <p class='text3' style='font-weight: bold;'>Select Match Type</p> <form action='promotions.php?promotion_id=$promotion_id&show_id=$show_id&add_match' method='post'> <p class='text3'> <select class='text4' size='20' name='match_type' onchange='showUser(this.value)'> <option value='1'>1 vs 1</option> </select></p> </form> </div> </div> <div style='width: 362px; float: left'> <div id='result'> $result </div> <div class='line'></div>"; } <script type="text/javascript"> function showUser(str) { if (str=="") { document.getElementById("result").innerHTML=""; return; } if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status==200) { document.getElementById("result").innerHTML=xmlhttp.responseText; } } xmlhttp.open("GET","promotions.php?promotion_id=$promotion_id&show_id=$show_id&add_match="+str,true); xmlhttp.send(); } </script>
  6. $sql_book_show = mysql_query("INSERT INTO Show (promo_id, date, description, name, venue) VALUES ('$promo_id' , '$show_year,$show_month,$show_day' , '$show_prev' , '$show_name' , '$show_venue')") or die (mysql_error());
  7. I am getting this SQL query error message: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Show (promo_id, description, name, venue) VALUES ('1' , 'This is a test.' , '' at line 1
  8. How would I put today date for instance into mysql_query? I just want the date and have the format be year, month, day. The format in the database looks like 2010-04-05. That being used as an example. And I have three drop down menus, which you can select the year, month, and day, but it doesn't seem to be working. What am I doing wrong?
  9. It goes through everything correctly it just doesn't place the image into the directory. What am I doing wrong?
  10. This doesn't seem to be working. Any help? if (isset ($_POST['edit_poser'])){ $errormsg = ""; if (!$_FILES['userfile']['tmp_name']){ $errormsg = "<font style='color: #ff0000;'>Select an Image</font>"; } else { $maxfilesize = 51200; if ($_FILES['userfile']['size'] > $maxfilesize){ $errormsg = "<font style='color: #ff0000;'>Image is too large, select a smaller one</font>"; unlink($_FILES['userfile']['tmp_name']); } else if (!preg_match("/\.(gif|jpg|png)$/i" , $_FILES['userfile']['name'])){ $errormsg = "<font style='color: #ff0000;'>Image needs to be gif, jpg, or png</font>"; unlink($_FILES['userfile']['tmp_name']); } else { $newname = "image01.jpg"; $place_file = move_uploaded_file($_FILES['userfile']['tmp_name'], "Members/$id/".$newname); $errormsg = "<font style='color: #ff0000;'>Your image has successfully been updated</font>"; } } } // ends first if statement
  11. username.css could be used to change there layout? Like different colors and such?
  12. I was wondering if there was a way to allow users to input there own HTML and CSS in like a members only site using PHP? If so, how would it be done?
  13. Nevermind. I just had to remove the '' around my database field name and now it works. Thanks for the help.
  14. Okay I did this, but mine is still bringing back no results.
  15. Anyone know what I am doing wrong?
  16. I am checking to see if last_login_date is between the Current Time and the time 10 Minutes ago.
  17. last_login_date is DATETIME and I assume $time and $current_time is UNIXTIME
  18. They are and I am still getting 0 as a result when I use mysql_num_rows.
  19. Okay I have another question. Why isn't this SQL query working??? $sql_members_online = mysql_query("SELECT last_login_date FROM Member WHERE last_login_date BETWEEN '$time' AND '$current_time'"); the $time is the time with 10 minutes subtracting from the current time and there is a last_login_date with datetime field, its just called last_login_date Any ideas?
  20. Oh so the strotime already subtracts 10 minutes from the current time?
  21. I know that it was displaying seconds. My problem is that I want it to subtract it from the current time. How would you do that?
×
×
  • 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.