How to create php script to detect cookies ? i've create one but i have to click refresh button once.
(MySql 3)
How to make MySql not insert data with whitespace ??
this is the case ?
$data = "this <---whitespace---> a long data";
$data = trim($data);
then i insert into MySql, but MySql will take "this <---whitespace---> a long data";
format not "this a long data", anyone can avoid this ???
If i want to take 100 character in MySql database, is there any query in MySql that provide this function ?? ( not the php script ).
thanks's for the answer, i got headache.
Sponsored by: █ Sparkhost - Hosting Without Compromises! █ Hybrid Performance Web Hosting █ Spark Host Stream Hosting █ Hybrid IRC & IRCd Server Shell Accounts
Cookie, Mysql Data ( Trim ), And Sorting Query
Started by
pixelgraph
, Nov 14 2005 03:54 PM
1 reply to this topic
#1
Posted 14 November 2005 - 03:54 PM
#2 Guest_stay_*
Posted 15 November 2005 - 06:53 AM
please use the code tag and numbers for your questions to make it more overviewable!
about trim(): it only removes whitespaces at the beginning and end of an string, not in the middle or anywhere else!
about your php cookie script: maybe you should get a php book or read some tutorials, so that you have the basics before trying to do things by yourself. btw, if i remember right, its $_COOKIE[name], so you can use
well, just saw your note that you already have one:
about trim(): it only removes whitespaces at the beginning and end of an string, not in the middle or anywhere else!
about your php cookie script: maybe you should get a php book or read some tutorials, so that you have the basics before trying to do things by yourself. btw, if i remember right, its $_COOKIE[name], so you can use
if(!empty($_COOKIE[name])) { echo"cookie avaible"; }well, just saw your note that you already have one:
cookies are sent from client to server, data is only transmitted if you request a new page/refresh the page, this is why you have to refresh/visit another page. there are some workarounds like using (fake)images (a php file that outputs an image), however it's not the best... however you can check for cookies later or build an auto refresh function (meta http quiv refresh), depending on for what you need cookies.have to click refresh button once.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users












