Jump to content


  • Posts

  • Joined

  • Last visited


Everything posted by dreamwest

  1. This works but dont know if its right: SELECT * FROM photo WHERE download_pics = 0 AND seo_pics IS NULL ;
  2. Just tried it but getting an error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IS NULL seo_pics ' at line 1
  3. Simple query but i need to select rows which have NULL in the field: $result = mysql_query("SELECT * FROM photo WHERE download_pics= '0' and seo_pics=' ' ") or die(mysql_error()); So all seo_pics rows/fields are NULL But seo_pics=' ' dosent work Ive tried seo_pics='NULL' but no luck
  4. Occasionally i have stings with "?" and " ' " and "," in them How can i get rid of these in one hit Example normal string: $title = "dog walks down path" str_replace(' ', '_', trim($title)) Outputs: dog_walks_down_path Example of string with ? and ' and , in it: $title = "i'd like to see the dog, wouldn't you?" str_replace(' ', '_', trim($title)) Outputs: i'd_like_to_see_the_dog,_wouldn't_you? You can see the problem, i need the output to be: id_like_to_see_the_dog_wouldnt_you Instead of: i'd_like_to_see_the_dog,_wouldn't_you?
  5. OK sweet Thought it was an error...
  6. echo $row['date']; This is your column name Change "date" to your column name You can echo whatever column/s in one while loop while($row = mysql_fetch_array($result)){ echo $row['date']; echo $row['date2']; echo $row['date3']; echo $row['date4']; } Give me you table name and column name and ill do it for you
  7. Trying to use paginate but the for loop isnt working . Somtimes ill only have 26 results (2 pages) but the links show -5,-4,-3,-2,-1,0,1,2,3,4,5,6,7 in the '>."$k."</a>"; part $tpage = ceil( 453 / 25 ); $search = GET['search_id']; $k = 1 - 5; for ( ; $k <= 1 + 5; ++$k ) { if (( 0 < $k ) || ( $k <= 18.25 ) ) { $page_links .= "<a class=pagination href='search.php?page=".$k."&search_id=".$search." '>."$k."</a>"; } }
  8. <?php $host = "****"; $user = "****"; $pass = "****"; $database = "*****"; //connect to the database mysql_connect($host, $user, $pass); @mysql_select_db($database) or die("Unable to select database"); $query = "SELECT * FROM wp_posts WHERE ID > 0 ORDER BY ID asc"; $result = mysql_query($query) or die(mysql_error()); while($row = mysql_fetch_array($result)){ echo $row['date']; } mysql_close();
  9. How can i trunicate a string?
  10. What does this mean if ( !( $result = mysql_query( $sql ) ) ) { }
  11. I have caching enabled for javascript through htaccess, but i dont want 2 specific js files to be cached . Is there a way i can add something to the js code to stop it from being cached?
  12. Im trying to match an extension of a file, but its allowing capital JPG to be included How can i ignore files that are capitals: Ignore - photo.JPG Match - photo.jpg $match = preg_match_all('/href="(.*?\.(jpg|jpeg))"/i', $html, $matches);
  13. Forget about looking for a script. Build one myself I am now a........senior script kiddie!
  14. Ive been using arrow trader on my vps but i need to install a trade script on a shared server, without root access. Is there a good/free script anyone can recommend?? *Besides cjoverkill
  15. Yes, both queries are producing the required results but when together one is interfering with the other. I cant figure out whats going on
  16. Im doing something wrong here...i just cant work this out. I need to select a table with columns and use the $row data to output results, then i want to select another table with columns but with a differnt query: $result = mysql_query("SELECT * FROM photo_import WHERE id_pics='15' ")or die(mysql_error()); $row = mysql_fetch_array( $result ); echo $row['id_pics']; ///Now select a new query but use data from the first query within the SELECT $result = mysql_query("SELECT * FROM ratings WHERE categories_pics = '".$row['id_pics']."' AND download_pics='1' ORDER BY RAND() LIMIT 20")or die(mysql_error()); while($row = mysql_fetch_array($result)){ echo $row['title']; } As you can see both queries conditions are different . The first query works but the second doesnt produce any results.
  17. Yes. Only if it has "HD" in the string. Is there a contains function like this?? if str_contains("HD"){ Then do it }else{ Dont do it }
  18. If i have 2 strings: 1234 and HD1234 How can i tell php to only use "HD1234"
  19. On tv its ok to have the occasional boring episode, but not in a movie I even went into this movie with an open mind. I mean xfiles is supposed to represent paranormal investigation. The only interesting thing in the whole movie was the 2 headed dog Anyways...looking forward to the next one and hoping they will make it more entertaining
  20. Now i do.. All my integer columns are made with INT and ive had no probs with sorting
  21. Make the column BIGINT with a value of 10
  • 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.