Bickey
Members-
Posts
43 -
Joined
-
Last visited
Never
Everything posted by Bickey
-
This is my SEARCH code. $like = "SearchWord LIKE '%".implode("%' OR SearchWord LIKE '%", explode(' ', $Var))."%'"; $query = "SELECT * FROM db1 WHERE $like ORDER BY ToDate ASC"; $results = mysql_query($query); Currently this code search every word in the MYSQL column. (e.g. If a user enter a 3 words and hit the search button, it still take the two words as individual words and outputs all records which has either of those 3 words.) My need is to make the code find ALL the search words match in any sequence. Example: Wooden toy for 3 year old Metal sward Dora cotton pillow Wooden sward if the user search using "wooden toy" the code should show only "Wooden toy for 3 year old" if the user search using "wooden" the code should show "Wooden sward" and "Wooden toy for 3 year old"
-
In my MYSQL db how do I format a single or two digit number to have 0 in front? (e.g. 005, 012)
-
How do I include .$email to the mail function. this is my current code: mail($to, $subject, "", $headers); I want do it like this; mail("me@myweb.com".$email, $subject, "", $headers); Thanks Bickey.
-
How can I make a specified IP access a certain folder (URL)? I came across this code but I'm not sure how to make it access just one folder AuthName "Protected" AuthType Basic <Limit GET POST> order deny,allow deny from all allow from 100.100.100. </Limit>
-
What is the syntaxt which is used to delete all records from a database? Thanks. Bickey.
-
yes. that was just for illustrative purposes (an example). I'm not too sure if it's safe to give the actual domain here. Any advice is highly appreciated. Thanks. Bickey.
-
How do I make the username and password checking CASE SENSITIVE? $result=sprintf("SELECT * FROM db WHERE username = '%s' AND watchword ='%s'", mysql_real_escape_string($username), mysql_real_escape_string($password)); Thanks. Bickey.
-
Why does the index show up when I hit a URL without a file name in the browser. E.g. www.nba.com/home/pic/player2.html - shows the webpage (as usual) BUT www.nba.com/home/pic/ - shows the file index inside that folder. What's the reason? How can I disable this?
-
the variables output is correct. But I think my code is causing problems. when I test with the first 2 conditions it works but when I add the 3rd condition it doesn't give the desired output. ... in the 3rd condition I want check if tf2 is blank AND tf says apple (both should be true in the 3rd condition).
-
I'm confused... how do you say check if the field in MYSQL is blank? it's not getting what I'm attempting to get. Please help. I want to do actionA... if either of these 3 conditions are true tf1=="RED" tf1=="" tf2=="" AND tf=="apple" if(tf1=="RED" or tf1=="" or tf2=="" AND tf=="apple") { do actionA... }
-
Thank you Pikachu2000. I'll give it a try.
-
I'm saving customer comments in an MYSQL. But the when I use mysql_real_escape_string() to filter the input data it's causing wired signs when it's displayed in the guest book. (E.g. whenever there is a ' sign, the output is \'). Is it safe to have a guest book without mysql_real_escape_string( or please suggest how should I go about creating this guest book on my website. Thanks. Bickey.
-
ok, looking at the table below, can someone tell me how to get the count of "MAX" in row 1? id field1 field2 field3 field4 1 MAX MIN MAX MAX 2 MIN MIN MIN MAX
-
How to write the code to get the count of the word "CHECKED" from a row? I tried this and it's not working. Please help. $query = mysql_query("SELECT field1, field2, field3, COUNT(CHECKED) as counter FROM db1 WHERE row_name = 'science'"); while($line = mysql_fetch_array($query)) { echo $query['counter']; }
-
Isn't there a way to echo a time for a particular time zone?
-
Thanks. But I'm having problems when I echo a time in different time zone. I get complaints from other countries saying they see different a time than the time. How can I solve this and make php echo a time for a particular time zone? (America/Chicago)
-
How do I echo the time in SECONDS? $tz = new DateTimeZone('America/Chicago'); $date = new DateTime('now', $tz); $mtime = $date->format('Y-m-d H:i:s'); echo ($mtime); E.g. 1296057739
-
Hi.... I'm unable to get the echo of $query2. Please help. Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in line 15 [-sorry!! I'vr fixed it.
-
How can I echo this as seconds? $date_at_timezone = new DateTimeZone('Asia/Shanghai'); $date = new DateTime(); $date->setTimezone($date_at_timezone); echo $date->format('l dS F Y h:i:s A') . "Asia/Shanghai<br>";
-
I want to have a line break between the lastname and the age. Please help. echo $line["firstname"].' '.$line["lastname"].' Age is'.$line["age"].'!';
-
Considering security, is there a disadvantage in using $_REQUEST?
-
Yep!!! that did it! Thanks! Bickey.