Jump to content

paulman888888

Members
  • Posts

    332
  • Joined

  • Last visited

    Never

Everything posted by paulman888888

  1. Hello; I keep getting this error MySql Error Which is not really an error because it doesnt tell whats wrong. Here's my code $check=mysql_query("UPDATE chess_events SET delete='$delete' WHERE id='" . mysql_real_escape_string($id) . "' ")or die(mysql_error); Please can you tell me what i have done wrong and why MySql Doesn't Give Me An Error! Thankyou Paul
  2. so is there anyway to get MOD rewrite the things after the question mark? like events.php?var_name=var_value is there no way i can get everything after the '?'? Thankyou Paul Hutchinson
  3. if that is what it is called then yes. Thankyou revraz But that doesnt help me in makeing the script. Ill start Googleing things to see i find anything. Thankyou all the same Paul Hutchinson
  4. I understand PHP quite well. I no how to collect infomation from a database find rows and as such. I want the output to be a list, (like below) Round 1 Blah1 vs blah 2 blah 3 vs blah 4 Round 2 blah 1 vs blah 3 balh 2 vs blah 4 and so on untill all play all Thankyou in advacne Paul
  5. hi; I am trying to create a simple tournament script. The amount of people who are in the tournamnt will change all the time so i cant use a fixed script. I no i need to use lots of loops but i dont no where. THIS IS THE PROBLEM! how do the loops join together. I think i need to do something like this; Get the amount of player Get the each name of a player and store in an array Then am stuck... Pair each one with another then pair again but the same person and so on untill all have played all! Please Help me Thankyou in advance Paul Hutchinson
  6. hi; I am trying to create a simple tournament script. The amount of people who are in the tournamnt will change all the time so i cant use a fixed script. I no i need to use lots of loops but i dont no where. THIS IS THE PROBLEM! how do the loops join together. I think i need to do something like this; Get the amount of player Get the each name of a player and store in an array Then am stuck... Pair each one with another then pair again but the same person and so on untill all have played all! Please Help me Thankyou in advance Paul Hutchinson
  7. if you use the first code the Just change the second part of it to this RewriteRule ^news/view/(.+)/?$ news/index.php?action=view&title=$1 [L] And get your PHP script to match up the titles. Hope i helped
  8. Hi guys; I don't no how to explain so i shall use an example. Users go to events.html MOD REWRITE shows page index.php?where=events THAT ABOVE WORKS FINE. But when i want to start using GET variables i get stuck. Users go to events.html?var_name=var_value MOD REWRITE shows page index.php?where=events&var_name=var_value I cant do the above because... The problem is that the GET variables will always change includeing value and name, i dont want to use loads of sub-folders like var_name/var_value/events.html How can i solve this problem? Please help me Thankyou all in advance Paul Hutchinson
  9. Please help me. <?php if(in_array($search_where2,$search_where3)){//check if allowed search if($search_where==$search_allowed[1]){//this works if i search for$search_allowed[1] $query = "SELECT * FROM "; $query.='chess_events'; $query.=" WHERE "; $query.='event_name'; $query.=" LIKE \"%$trimmed%\" "; $query.=" ORDER BY "; $query.=$order_by; } }elseif($search_where==$search_allowed[2]){//this doesnt work $query = "SELECT * FROM "; $query.='chess_location'; $query.=" WHERE "; $query.='name'; $query.=" LIKE \"%$trimmed%\" "; $query.=" ORDER BY "; $query.=$order_by; }elseif($search_where==$search_allowed[3]){not tested yet $search_table='chess_news'; $search_where4='title'; $query = "SELECT * FROM "; $query.='chess_news'; $query.=" WHERE "; $query.='title'; $query.=" LIKE \"%$trimmed%\" "; $query.=" ORDER BY "; $query.=$order_by; }else{echo'Error on Line 129: Error Matching Location to Search';} // Build SQL Query $numresults=mysql_query($query)or exit('Error on Line: 144'); $numrows=mysql_num_rows($numresults); // If we have no results, offer a google search as an alternative if ($numrows == 0) { echo "Sorry, your search: "" . $trimmed . "" returned zero results"; $search_error=665; echo'Error on Line: 145'; } // next determine if s has been passed to script, if not use 0 if (empty($_REQUEST['s'])) { $s=0; }elseif($_REQUEST['s']>=0){$s=$_REQUEST['s'];}else{$s=0;} // POST results $query .= " LIMIT $s,$limit"; $result = mysql_query($query) or die('Error on Line: 158'); } ?> What have i done wrong? I dont understand# Please Help me Thankyou in advance Paul Hutchinson
  10. Hi people; I have just learnt about .htaccess files and i think there great. I have never used them before so i think now is the time. What i want to do is let my uses type http://www.site.com/page/id/ and it show page http://www.site.com/index.php?where=page&id=id Can someone help me please? Thankyou Paul ps is there a site where i can go learn more about .htaccess files?
  11. hi people; Its a simple question // Build SQL Query $query = "SELECT * FROM "; $query.=$search_table;// The Table to Search $query.=" WHERE "; $query.=$query_where;//The Column to Search $query.=" LIKE \"%$trimmed%\" ";// $trimmed is my Search content $query.=" ORDER BY "; $query.=$order_by; $numresults=mysql_query($query); That's my code but i would like to search in more columns. So here's my question. How do i make my code search in more columns? I thought of something like the below but not sure if there even the correct syntax. //The part i think i need to add $query_where=$column1.' OR ' $column2;// Am i nearly right? // Build SQL Query $query = "SELECT * FROM "; $query.=$search_table;// The Table to Search $query.=" WHERE "; $query.=$query_where;//The Column to Search $query.=" LIKE \"%$trimmed%\" ";// $trimmed is my Search content $query.=" ORDER BY "; $query.=$order_by; $numresults=mysql_query($query); Thankyou All Paul
  12. I dont think you understand. Ill explain more. I have my data in a database and need a search engine to go though my database (more than one table to search)!
  13. I been trying (for a long time), to create a Mysql, PHP search engine. I can do simple ones but i can't do ones that search under different colums. Can you tell me a site please? Please help me Paul Hutchinson
  14. Simple Question; What have i done wrong again? Its my little search engine page. Have more than one table the user can search. I have limited the tables the user can see so theres no sercurity problem. Heres the code // Build SQL Query $query = "SELECT * FROM `$search_where` WHERE '$search_name' LIKE \"%$trimmed%\" ORDER BY id"; // EDIT HERE and specify your table and field names for the SQL query $numresults=mysql_query($query); $numrows=mysql_num_rows($numresults);//this is line 62 Heres the error EDIT: I have just done another try and i got no errors but i also got no search results. I no theres is some but why am i not getting any? Thankyou all in advance Paul
  15. Hi guys; Simple question WHAT HAVE I DONE WRONG? Thats the error! $ephp9=date('y').'/'.date('m').'/28'; $event_28 = mysql_num_rows(mysql_query("SELECT FROM chess_events WHERE thedate='$ephp9'")); Heres the code! Thankyou All Paul
  16. Hello again my amazing friends. I been looking for a calendar script but i have yet to find the one for me! I am looking for a PHP calendar that i can add things to. Eg; Fetch data from MySql Show the Calendar Add extra things to the calendar when needed. I no this needs alot of loops but as you can now guess. I dont no how to go about this. Is there a very simple script out there for me, (Please dont say the one's with loads of features, i WANT TO LEARN how it works) Thankyou All in advacne Paul
  17. yes very simple and easy. Make a loop! Because you haven't give any code i get show you how to do it. Hope i Helped Paul
  18. Hello my PHP friends; I no how to use str_replace but i can't think of a sollution to this probelm! My string is in this format AAAA|BB|CC and i want to rearange the format to CC|BB|AAAA! Think of it as a date and you want to change the format around. So how would i go about doing this? Note: The letters are place holders for numbers. The Numbers may appear in all C,B and A. << Just incase that makes a problem! Thankyou All in advance! Paul
  19. hi people; I understand PHP and MySql to a certain degree but i never understand sessions. I am looking for a very simple and basic PHP login script. I know i need these pages; login.php <<--To log the user in I can do this logout.php <<--To log the user out I can do this session_any.php <<--To allow anyone to view the page and keep the session going I can't do this session_safe.php <<--To only allow logined in users to the page I can't do this Please can some tell me a site i can go to to learn the basics, or a very simple script allready made that i can learn from! Thankyou All in advance Paul
  20. Thankyou flyhoney. I didn't think of that. Built the script the only way i new. Thanks mate Your amazing
  21. I tryed but for some reason it wont work. Heres my code <?php error_reporting(E_ALL); include'connection_1.php'; $strr = $_GET['only']; $strr = strtolower($strr); $allowedonly = array('upcoming', 'events'); if(isset($_GET['only'])){ if(in_array($strr,$allowedonly)){ if($strr='upcoming'){$opp='>';} elseif($strr='past'){$opp='<';} $sort="WHERE date_field ".$opp." '".date("Y-m-d")."'"; }else{$error='Search Not Found';$sort='';}}else{$sort='';} $result = mysql_query("SELECT * FROM chess_events '$sort'"); ?> and i get error Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/site/events.php on line 46 thankyou for all the help! Paul
  22. Hi guys; Ill get straight to the point! I am trying to use the DATE function but i don't now how to use it will Mysql. Ill explain; Am trying to use a PHP to get results from Mysql where the date is before today. I would like to say thankyou in advance. Paul
  23. I am using SMF, same forum as this one (PHPFREACKS)! I would like to know if i could use a table used by SMF for the rest of my website! Please can you tell me how i would go about this! Thankyou Paul
×
×
  • 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.