bigfatme2000
Members-
Content Count
35 -
Joined
-
Last visited
About bigfatme2000
-
Rank
Member [ Level 1 ]
-
Searching with PHP and MySQL is pretty easy when you think about it, especially if you're doing it the simple way (without boolean or whatever) It consists of a few forms, a query and an output. As I said, simple! <form name=\"form1\" id=\"form1\" method=\"post\" action=\"<? $php_self ?>\"><table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"2\"><tr><td style=\"text-align: center;\"><input name=\"search\" type=\"text\" id=\"search\" /></td></tr><tr><td style=\"text-align: center;\"><input name=\"submit\" type=\"submit\" id=\"submit\" value=\"Search!\" /></td></tr></table></form> The form that you just made contains a text input that people will type into, the next code will extract the form data and then search it.. Form processing $search = htmlspecialchars(addslashes($_POST[\\\'search\\\']), ENT_QUOTES); if(isset($_POST[\\\'submit\\\'])) { if(!$search) { echo \\\"No search entered, please go back and fill in the fields properly.\\\"; } else { $query = mysql_query(\\\"SELECT * FROM table WHERE field LIKE \\\'%$search%\\\'\\\"); $resultnum = mysql_num_rows($query); // Just print $resultnum if you want to show how many results returned if($resultnum>0) { // Echos out matches if anything was found while($row=mysql_fetch_array($query)) { // Starts spitting out the data echo \\\"You can put a link to the result article here, or something else. This is what\\\'ll show up when a user gets a result, for each result.<br />\\\" } } } } else { echo \\\"<p>No search entered?</p>\\\"; } And that's it. Let me just break this down for you htmlspecialchars(addslashes: This line does two things; it cleans out any chance of an SQL injection to your database, and then it adds slashes to the value which makes the search more accurate. If you don't add slashes, then if you searched for cheese, it would return anything with a c, h, e or s in your database. So much for search relavance, eh? $query = mysql_query(\\\"SELECT * FROM table WHERE field LIKE \\\'%$search%\\\'\\\"): This is the query that does the search. Notice the percentage signs in the LIKE part - don't forget these. They work as wildcards. And the rest I'm sure you'll understand.
-
My host (which for obvious reasons has to stay hidden)'s php has gone silly!It is running cPanel - and includes are not working - and returning the message 'Access Denied'! Anyway, it isn't the scripting or permissionas i have tried it on another host's account!Any ideas?(That is the reason I will be signing up here on Xisto - its is a good and reliable host - and the moderator 'Dooga' has pointed me here! So thank him! Anyway - back on topic has anyone ever had this?.. Where one minute your PHP is working fine- then nothing works? The host may be using a rubbish server!
-
Great poems there - well done! I wish i had talent - well i can sing in the shower (but we won't go there )Anyway, back on topic lol, good work - do we have permission to use that poems on the loves in our lives? I personally think they all are very good - and imaginative. You obviously have deep personalities!
-
Hello I know this is a little different, but I was talking to a friend a day or two ago about this girl he really liked. He realy likes her, and he think she likes him too. But The point is, she LIKES ME!!!!! I like her more than a friend - so we both like each other. Although he is my best friend, and I don't want to hurt him.What should I do?.. Break the girls heart - or hurt my mate? I would apreciate your comments
-
Anyone else have this problem? I used to be able to use rapidshare fine - only the past day or so, its done this!!!! Firstly, I am not downloading anything, and the weird bit is - it's not even my IP address!!! Not using a proxy either or anything! I have read somewhere it might be somthing to do with my ISP? Ah well, no rapidshare for me!
-
These theme parks do do well - it just gets me to the fact why they need to charge so much - i mean they must make a mint!
-
Ps3 Is Expected To Be Released Late.. is it good or bad?
bigfatme2000 replied to Sympatico's topic in Computer Gaming
We have all waited a long long time for the PS3 - and it is gonna be so costly coming out, most of us won't be able to afford one for a long time anyway. As we have waited such a long time - im sure we can wait another few weeks or something. As for all this, it may all be false. Big companies like sony wouldn't announce a release date for such a big thing, without leaving enough 'Safe time'. I bet they finished the PS3 last year - and are just testing it now. I wouldn't worry Whoever said that they will only sell a couple of thousand - HAHAHAHA This is getting released wordwide - they will sell Billions during its lifespan! I prefer PlayStation - but does this really mean it is the best console?.. Is it just that it is the most popular? -
I agree with you on that one! There are many videos doing the rounds - and almost every console is getting destroyed in them! A PSP getting bricked, or a virus thingie on the DS. I cannot wait until the PS3 comes out - i don't think ANYBODY will pay all that money - and then brake it! PS3 are gonna cost loooaaadddds. I was chuffed with my PSP though - Ive never owned an XBox - and wouldn't want to either! PLAYSTATION RULZ.
-
Thats all too true for ny liking. All we can do is hope one doesn't come around here - a black whole is the center of an exploded star.... or so i read! There aren't any around us (or that we have found) - so we shouldn't get too worried.
-
Eww, thats horrible! I used them before the ACORN computers! I don't like Macintosh... They will never be better that windows - a pc is only hated by more people, because it is used by more people in the first palce! My mouse has 5 buttons - and i wouldn't be able to survive without all of them!I mean how would you get used to one button? - It isd so small you would have to use glasses to find it in the dark.I dissagree with this invention - Apple should stick to being just a fruit - as they are an insult to technology!
-
I voted McDonalds - their Double Cheese Burgers are to die for!
-
Grr - you are right - thanks for making that clear to me - much apreciated!
-
What will end first?... Earth or the universe?.. This might seem a silly thing - but think about it - what will it be? They are thinking today that they may of got it wrong about the start of the universe - the stars may be going further apart - but is the universe coming closer in Hey - we can't get to the outside of the universe - so we don't know what is happening - we could get squashed like.. NOW Oh no.. i hope not - not until after christmas anyway Notice from cmatcmextra: Moved from What Is..?
-
A very nice and clean template - cool! I like the advertise column - and the cute login box at the top - nice!
-
GTA is one of the best, and fastest growing game and is going to be a big hit this Christmas.Which is your favourite? You remember the shock and suprises we had while we un wrapped San Andreas, well imageine a great improvement GTA:LCS is going to have on GTA 3 and just think - what will the PS3 bring for GTA - (Or should i say what will GTA bring for GTA ) - with blue-ray disks and all that!