Jump to content

moselkady

Members
  • Posts

    131
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

moselkady's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. You should do it like this: $query = mysql_query("UPDATE websites SET exelent=exelent+1 WHERE url='$url'") or die(mysql_erro r());
  2. Try this one: $sql = "INSERT INTO i_usr VALUES (NULL, '$username, '$password, '$email', '$handle')";
  3. You need to do it all in one query. This example will nor work: DELETE FROM messages WHERE ID != 1; DELETE FROM messages WHERE ID != 2; The first query deletes all (including id 2) except id 1 then the second deletes id 1. I think you can modify your code to something like this: <?php foreach($_POST as $a => $b){ if(preg_match("/x/",$a) && $b == 'y'){ $ids[] = str_replace("x","",$a); } } $id = join(",", $ids); $note_query = $db->query("DELETE FROM `" . DBPREFIX . "messages` WHERE `ID` NOT IN (".$id.") AND `ReciverID` = '".$_SESSION['user_id']."' "); ?>
  4. Use explode to split the string into several array elements: <?php $string = "first, second, thid, fourth, fifth"; $array = explode(", ", $string); ?>
  5. One other thing, try to print $rename (or whatever you sql variable) in case you get an error to better figure out the problem.
  6. A small fix to ohdang888's solution: $rename = 'alter table Element_'.trim($title).' change '.$column_name.' '.$check_item.' varchar(50)';
  7. My understanding is that you cannot upload a file using AJAX and that the only way to upload a file is to submit a form that contains <input type='file'> field. This is the only way you php script will receive $_FILE variable. I may be wrong though
  8. You can try this: <?php $line = '[CISC26907] Digits are not heard properly over H.323'; echo ereg_replace(".*(\[CISC[0-9]+\]).*", "\\1", $line); ?>
  9. Try modifying your if statement: if (sizeof($lines) == 0){
  10. You can make a loop similar to this one: <?php $i = 1; while(true) { if (!isset($_POST["white_move_".$i])) break; // do whatever you'd like with $_POST["white_move_".$i] $i++; } ?>
  11. Could you post the output the you get and also the output that you want to see?
  12. Well, this is only possible if your HTML is generated by PHP. If you form is in regular HTML files, then I think you have to go with DarkWater's solution.
  13. Maybe you can add this hidden field: <input type='hidden' name='src_file' value='<?php echo $PHP_SELF?>'>
  14. I just clicked on both "you welcome" and "good luck" buttons
  15. I am not sure in what order AND and OR are evaluated in MySQL but it looks like your query is behaving like this: SELECT * FROM members WHERE (PHArea='$areaCode' OR MOArea='$areaCode' OR FXArea='$areaCode') AND PaidID!=' ' Try to use parenthesis to formulate the conditions you want.
×
×
  • 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.