Jump to content

FuThAr

Members
  • Posts

    17
  • Joined

  • Last visited

    Never

Everything posted by FuThAr

  1. Pay attention. Maybe you'll lost blocks of data. http://smartmontools.sourceforge.net/badblockhowto.html
  2. you can group your results by username, then count them in the way you prefer $getusers="SELECT * FROM `tblonline` WHERE `usertype`='user' GROUP BY `username` "; it will give you one result per-user logged
  3. 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
  4. 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
  5. 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"); } [...]
  6. 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
  7. 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>";
  8. from php.net in your code there is output instead.
  9. 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
  10. 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);
  11. 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
  12. 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
  13. include just one file or use __autoload for multiple inclusions
  14. 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
  15. 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?
  16. 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);
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.