clearstatcache
Members-
Posts
159 -
Joined
-
Last visited
Never
Everything posted by clearstatcache
-
You may use tinyint length = 1. 1 for true and 0 for false
-
You may use tinyint length = 1
-
try this... $delete_query = "delete links, pagelinks from links left join pagelinks on links.linkid = pagelinks.linkid where links.linkid=ID";
-
the file you include is not found by the script...may be you have a wrong include_path...
-
make sure your $id has a value......
-
remove the comma before the Where
-
you forgot the single qoute for town='$town'
-
[SOLVED] Shorter way to find out day and pass to folder
clearstatcache replied to a topic in PHP Coding Help
$day = date('D'); $image_dir = $day.'/screen/'; -
i think if else is more applicable in this situation....
-
[SOLVED] Filling in row gaps while autoincremented
clearstatcache replied to lordvader's topic in MySQL Help
u used that key as unique_key......aside from ur primary key....u need to have another index(s) which is unique in your table.....to be more efficient.... -
try changing preg_match("/\<Link\>/", $line) to preg_match("/http:\/\//", $line)
-
[SOLVED] Filling in row gaps while autoincremented
clearstatcache replied to lordvader's topic in MySQL Help
how about adding another index key.....say, Sequence_Key..... -
use function define in defining your variables in your config.php for you to be able to get the values defined in your config.php. http://www.php.net/manual/en/function.define.php
-
not sure if this is what u want.... $str = "www.something.com"; $new = preg_replace("/($str)/", "<a href=$1>$1[/url]", $str);
-
just a syntax error...forgot the $ sign in first line... date1=array(); ==> $date1 = array();
-
try this... $line = "<Link> I WANT TO EXTRACT THIS 3 </Link>"; if (preg_match("/\<Link\>/", $line)) { $clean = preg_replace("/(\<Link\>)|(\[b\])|(\[\/b\])|(\<\/Link\>)/", "", $line); } print "$line\n"; print "$clean\n";
-
Mastering Regular Expressions, Third Edition, is available.
clearstatcache replied to effigy's topic in Regex Help
I found the book in electronic format (.chm), someone maybe interested so I thought I'll share it with others: where can i find that copy?? -
i think you need to save ur current reference value to another table...something like a system_config table....and each time you save new data to your table, u access this table..... just a suggestion.....hehehe =)
-
this works in me.... <?php $location = array( 'uk' => 'United Kingdom', 'af' => 'Afghanistan', 'al' => 'Albania', 'dz' => 'Algeria', 'as' => 'American Samoa', 'ad' => 'Andorra', 'ao' => 'Angola', 'ai' => 'Anguilla', 'aq' => 'Antarctica', 'ag' => 'Antigua And Barbuda', 'ar' => 'Argentina', 'am' => 'Armenia', 'aw' => 'Aruba', 'au' => 'Australia', 'at' => 'Austria', 'aw' => 'Aruba', 'ax' => 'Aland Islands' ); $result_nation = 'ar'; echo "<select class=\"forminput\" name=\"result_nation\">"; foreach ($location as $key => $value) { echo "<option value=\"$key\""; if ($key==$result_nation) { echo " selected"; } echo ">$value</option>\n"; } echo "</select>"; ?>
-
[SOLVED] Parse error: syntax error, unexpected T_FINAL
clearstatcache replied to Stevan's topic in PHP Coding Help
if final is a string u add single quotes Line 2 = <? if ($val != 'final'){} ?> if final is a variable Line 2 = <? if ($val != $final){} ?> -
<?php $a = mysql_query(" select q1.reply from ( select reply, count(*) as data_cnt from sample where 1 group by reply ) as q1 left join ( select reply, count(*) as check_cnt from sample where `check`=1 group by reply ) as q2 on q1.reply=q2.reply where data_cnt = check_cnt "); while($b = mysql_fetch_assoc($a)) { mysql_query("DELETE FROM `table` WHERE `reply` = '$b[reply]'"); } ?>
-
dunno if i get u right..... $file = "file.html"; $stat = stat($file); if ( (time() - $stat['mtime']) > 600) { // 600 seconds // send email .... }
-
using multiple "LIKE" arguments in a query
clearstatcache replied to anarchoi's topic in PHP Coding Help
select * from table where FIELD like '%$text1%' or FIELD like '%$text2%' -
try this one...... <?php function bximagecrawl($name) { $url = "http://images.google.com/images?hl=en&q=$name&btnG=BX&gbv=2"; $user_agent = "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_FAILONERROR, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); curl_setopt($ch, CURLOPT_PORT, 80); curl_setopt($ch, CURLOPT_TIMEOUT, 5); curl_setopt($ch, CURLOPT_USERAGENT, $user_agent); $document = curl_exec($ch); $images = array(); $images = explode('img src=http://', $document); array_shift($images); foreach($images as $key => $value) { $tokens = preg_split('/\>|\"| /', $value); $images[$key] = "http://".$tokens[0]; } return $images; } $name = 'danielradcliff'; $images = bximagecrawl($name); print_r($images); ?>
-
not sure wd this.....hehehe <?php function bximagecrawl($name) { $url = "http://images.google.com/images?hl=en&q=$name&btnG=BX&gbv=2"; $user_agent = "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_FAILONERROR, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); curl_setopt($ch, CURLOPT_PORT, 80); curl_setopt($ch, CURLOPT_TIMEOUT, 5); curl_setopt($ch, CURLOPT_USERAGENT, $user_agent); $document = curl_exec($ch); $images = array(); $images = explode('href="http://', $document); array_shift($images); foreach($images as $key => $value) { $tokens = preg_split('/\>|\"| /', $value); $images[$key] = "http://".$tokens[0]; } return $images; } $name = 'danielradcliff'; $images = bximagecrawl($name); print_r($images); ?>