Jump to content

phpretard

Members
  • Posts

    821
  • Joined

  • Last visited

    Never

Everything posted by phpretard

  1. I get the same error without the single quotes and using: $result = mysql_query("SELECT * FROM URLS WHERE id<='".$GetId."' "); if (!result){die(mysql_error());} while($row = mysql_fetch_array($result)) { mysql_query("DELETE FROM URLS WHERE id<='".$delete."' "); }
  2. I am trying to delete about 10K rows. The script works without the form. With the from I get the error: Warning: mysql_query() [function.mysql-query]: Unable to save result set in ... on line 20 Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in ... on line 24 if (isset($_POST['deleterows'])){ include ("../connect.php"); $GetId=$_POST['rowsNum']; $delete=$_POST['rowsNum']; echo $GetId; $result = mysql_query("SELECT * FROM URLS WHERE id<='$GetId'"); //<<<< LINE 20 if (!result){die(mysql_error());} while($row = mysql_fetch_array($result)) //<<<< LINE 24 { mysql_query("DELETE FROM URLS WHERE id<='$delete' "); } mysql_close($con); } // END IF else{ echo" <form action='' method='post'> <font face=arial>Delete All Rows And Lower Starting With:</font><br> <input type=text name='rowsNum' size='40' autocomplete=off> <input type=submit name='deleterows' value='Delete'> </form> "; } // END ELSE I can't seem to find the problem. Any help today?
  3. It still shows all even with PaidID='0'
  4. I can't figure out why this query still shows results where PaidID='1'. The url calling this would be: ...?page=listing/results&State=FL OR $SEARCH="FL"; << Session if (!ereg('[^0-9]', $SEARCH)){$searchResult = mysql_query("SELECT * FROM members WHERE ZipCodes LIKE '%$SEARCH%' AND PaidID!='1' ");} elseif (!ereg('[^A-Z]', $SEARCH) && (strlen($SEARCH) == 2)){ $searchResult = mysql_query("SELECT * FROM members WHERE PaidID!='1' AND LicState LIKE '%$SEARCH%' OR LicState2 LIKE '%$SEARCH%' OR LicState3 LIKE '%$SEARCH%' OR LicState4 LIKE '%$SEARCH%' "); } elseif (isset($_GET['State'])){ $searchResult = mysql_query("SELECT * FROM members WHERE PaidID!='1' AND (LicState='$State' AND Counties LIKE '%$SEARCH%' ) OR (LicState2='$State' AND Counties2 LIKE '%$SEARCH%') OR (LicState3='$State' AND Counties3 LIKE '%$SEARCH%') OR (LicState4='$State' AND Counties4 LIKE '%$SEARCH%') "); } elseif ($SEARCH=="EXAMPLE"){ $searchResult = mysql_query("SELECT * FROM members WHERE PaidID!='1' ORDER BY RAND() LIMIT 5"); } else{ $searchResult = mysql_query("SELECT * FROM members WHERE PaidID!='1' AND Counties LIKE '%$SEARCH%' OR Counties2 LIKE '%$SEARCH%' OR Counties3 LIKE '%$SEARCH%' OR Counties4 LIKE '%$SEARCH%' "); } Could anyone tell me? Thanks.
  5. I have come up with this... onKeyDown=\"if(event.which==13||event.keyCode==13){alert('Please Click The Search Button')}\" I was hope for a real solution.
  6. I have been searching the internet for 2 hours and nothing refers to an image as the submit obj. So should I $rephrase the question? if ($rephrase=='Yes'){$question="How can I force the focus?";} else {echo"beat it with this question!";}
  7. Andy-H: I don't get it? Yes I am using <input... There was a lot of useless info to post (my bad). I should mention it works great when the image is "clicked". It does work in firefox but...I wish everyone used firefox. Any work around for IE?
  8. Thanks for the quick response. // FORM PAGE <form action='SUBMITPAGE' method=post> <input type='text' name='PrimSearch' /> <type='image' src='/images/search.gif' name='MainSearch' /></td> </form> // SUBMIT PAGE if (isset($_POST['MainSearch_y'])){ echo "Enter Button Won't Work"; }
  9. I have form using an image as a submit button. It won't submit when I press enter...only if I click the button. This may not be a PHP help but I figured I throw it out here and see if anyone could point me in the right direction. I've been all over Google and the only reference I could find was standard type='submit'. ...and yes if (isset(I_Know_y)){ blah
  10. I took your advise on both post (THANK YOU!) I now get: mysql_num_rows(): supplied argument is not a valid MySQL result resource...on line 17 if (!ereg('[^A-Z]', $SEARCH) && (strlen($SEARCH) == 2)){ $searchResult = mysql_query(" SELECT * FROM members WHERE LicState LIKE '%$SEARCH%' OR LicState2 '%$SEARCH%' OR LicState3 LIKE '%$SEARCH%' OR LicState4 LIKE '%$SEARCH%' ");} if (!searchResult){die(mysql_error());} $num_rows= mysql_num_rows($searchResult); << -------- LINE 17 echo $num_rows." FOUND"; } Any ideas on this?
  11. Does anyone know why I would get this? Fatal error: Can't use function return value in write context $SEARCH="AB"; if (!ereg('[^A-Z]', $SEARCH) && (strlen($SEARCH) = 2))){ $searchResult = mysql_query(" SELECT * FROM members WHERE LicState LIKE '%$SEARCH%' OR LicState2 '%$SEARCH%' OR LicState3 LIKE '%$SEARCH%' OR LicState4 LIKE '%$SEARCH%' ");} if (!searchResult){die(mysql_error());} $num_rows= mysql_num_rows($searchResult); echo $num_rows." FOUND"; I am looking for: "1 FOUND" ...and I get: Fatal error: Can't use function return value in write context Thank again!
  12. Can anyone see why this would return error: Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource $searchResult = mysql_query("SELECT * FROM members WHERE LicState LIKE '%$SEARCH%' OR LicState2 '%$SEARCH%' OR LicState3 LIKE '%$SEARCH%' OR LicState4 LIKE '%$SEARCH%' "); if (!sql){die(mysql_error());} $num_rows = mysql_num_rows($searchResult); echo $num_rows." FOUND"; Thanks!
  13. So if my conection was var $con then it would be: global $con ?
  14. Thank you...I have much to learn. PS. What is global $db;
  15. How can I convert the code below in a funtion. I then need to call it out and see the results. echo"<select name='SiteArea'>"; $resultshape = mysql_query("SELECT * FROM shape"); while($row = mysql_fetch_array($resultshape)) { $id=$row['id']; $name=$row['name']; echo "<option value='$name'>$name</option>"; } echo "<select>"; Any help today? -Anthony
  16. I know how to cnovert files to PDF. Does anyone know how to convert files to .VSS Any tutorials, pointers, etc... anything would be helpful. It's a Visual SafeSource file. http://msdn.microsoft.com/en-us/library/aa302175.aspx#vssmap_topic2 Thanks! -Anthony
  17. Put this before session start and you're good to go! header('P3P: CP="CAO PSA OUR"');
  18. I am losing my session $vars after redidecting within a frameset? Any suggestions. This code works great without frames involved so I was hoping there was a trick to a frame. $result = mysql_query("SELECT * FROM table WHERE this='$that"); while($row = mysql_fetch_array($result)) { $MemberID=$row['MemberID']; $Type=$row['Type']; $UserID=$row['UserID']; $CLFirstName=$row['CLFirstName']; $CLLastName=$row['CLLastName']; } $_SESSION['MemberID']=$MemberID; $_SESSION['Type']=$Type; $_SESSION['UserID']=$UserID; $_SESSION['LastLog']="$DATE_TIME_STAMP"; echo "<pre>". print_r($_SESSION,true) ."</pre>"; <<< I KNOW THEY GET SET HERE header("Location: ?page=orderform"); <<< THEY"RE GONE WHEN YOU GET TO THIS PAGE } This is all done inside of a frame. Does anyone know what's wrong or the "trick" to passing session within frames? PS. Yes I hate frames...it's my only option.
  19. I see what you mean... <?php session_start(); $_SESSION['PoolID']="Stuff"; if (!empty($_SESSION['PoolID'])) { setcookie('session', 'active', time()+20); } else { header ('Location: http://www.google.com'); exit; // exit the current script } if (!isset($_COOKIE['session'])) { session_destroy(); // if not, destroy session header ('Location: http://www.google.com'); exit; } echo "<pre>". print_r($_SESSION,true) ."</pre>"; ?> So how do check for the cookie on the same page?
  20. I just do not want people sitting Idle on my site (logged in)
  21. // THERE SHOULD BE SOME CONDITION HERE <<<< IT MISSING SURLEY........... //LIKE YOU BEEN TOLD YOUR GOTO GOOGLE REGARDLESS, UNLESS YOU ADD ANOTHER CONDITION This is the part I need help with.
×
×
  • 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.