FuThAr
Members-
Posts
17 -
Joined
-
Last visited
Never
Everything posted by FuThAr
-
Pay attention. Maybe you'll lost blocks of data. http://smartmontools.sourceforge.net/badblockhowto.html
-
you can look at this example $fp = fopen (dirname(__FILE__) . '/downloaded/my_file', 'w+'); $ch = curl_init('http://server.where.interesting/file.resides.com/123.doc'); curl_setopt($ch, CURLOPT_TIMEOUT, 40); curl_setopt($ch, CURLOPT_FILE, $fp); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); curl_exec($ch); curl_close($ch); fclose($fp) pay attention to the curl_setopt() http://gt.php.net/manual/en/function.curl-setopt.php optionally, at the begin of the script you can set set_time_limit(0); // to prevent timeout for big file download ini_set('display_errors',true);//useful for debug purposes
-
for debug purpose, it would be better if you echo a mysql_error() ... like this [...] if ( !is_resource($result) ){ echo "DEBUG: " . mysql_error() . "<br />"; } [...] otherwise, without other informations, for us is difficult help you bye Alberto
-
formally speaking, your code seems to be good. [...] $my_res = mysql_query("SELECT * FROM engines WHERE keyword = '$GKeyword'"); if ( is_resource($my_res) { $founded = mysql_num_rows($my_res); if( $founded == 1){ echo "founded one result, as expecteed" . "<br />"; } else { die("there is a problem: founded $founded entries"); } } else { die("no resource created"); } [...]
-
mysql_query() returns a resource on success, and FALSE on error (it's your case). so, it seems that you must check your query .. or simply check if $sql is_resource(), and then manipulate data
-
my code wont insert data from form into the database
FuThAr replied to silverglade's topic in PHP Coding Help
there are a lot of ways: simply switch off every output before header() call, or if you can't ... use javascript, with client redirection echo "<script type='text/javascript'>window.location='http://your.success.page.html'</script>"; -
my code wont insert data from form into the database
FuThAr replied to silverglade's topic in PHP Coding Help
from php.net in your code there is output instead. -
my code wont insert data from form into the database
FuThAr replied to silverglade's topic in PHP Coding Help
let's look at the error: $res = mysql_query("INSERT INTO users (password,email) VALUES ( '$Password' , '$Email')"); if ( !$res ) { echo "** debug: " . mysql_error() . " ** </br />"; } else { echo "**debug: " . mysql_affected_rows() . " affected rows ** </br />"; } Alberto -
my code wont insert data from form into the database
FuThAr replied to silverglade's topic in PHP Coding Help
in your code there you say "if mail doesn't exists, update the row where the mail is $email" ... it's impossible, so he can't update: try an INSERT query INSERT INTO users (password,Email) VALUES ( $Password , $Email); -
junction table, is a "cross-reference" table, a link table between 2 or more table, with common fields from them. GroupContactsId is the PK of the tblGroupContacts. It depends of the db/data structure, bit if you set the couple groupId-ContactId as PRIMARY KEY, you dont need the GroupContactsId
-
in the first section, please add this $column1 = mysql_query("SELECT * FROM Main") if ( !$column1 ) { die("error found: " . mysql_error() ); } please tell us the result
-
include just one file or use __autoload for multiple inclusions
-
hi all, kickstart is right, i only say that you can try also TIMEDIFF (x,y): it gives exactly hh:mm:ss elapsed. so you can manipulate this output to say only "minutes ago" if is for example 00:xx:xx or "hours ago" if is something like xx:xx:xx, or days if you want sorry for the "intrusion", bye Alberto
-
Hi Simon, One question: in Italy we say "fear of the white sheet"(i don't know the exact translation ...) , do you feel in that way? You don't know your start point, your "first step"? I don't want to be unpleasant, but i say: take a paper and write a simple "pseudocode", and then your first simple code, and go on ... and then post, someone will help you I'm wrong?
-
sorry for the reply. Alberto
-
i think you can use a single UPDATE query, with a CASE/WHEN/THEN statement (for each char), and the REGEXP operator: UPDATE contacts SET phone = ( CASE WHEN phone REGEXP '.*-.*' THEN replace(phone,'-','') ELSE phone WHEN [...] THEN [...] ELSE [...] END);