Jump to content

xerodefect

Members
  • Posts

    13
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

xerodefect's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Mysql querys with insert never output errors so if there is one do a mysql_error(); on them or or die(mysql_error()); and see what happens.
  2. Your looping function is working but may I suggestion putting the for($PK=1; $PK<1250; $PK += 1) { above ### CREATE OUTPUT FILE try that? else its something in your script messing it up,
  3. It seems like you have a mysql query error. Try this Find: $result=mysql_query($sql); Replace with: $result=mysql_query($sql) or die(mysql_error()); and see if any errors show up... also your second mistake is mysql_fetch_array keys are put in numbers so it would really be $rows[0]; but there is a way to fix that from changing while($rows=mysql_fetch_array($result)){ to while($rows=mysql_fetch_array($result, MYSQL_ASSOC)){ or changing fetch_array to fetch_assoc =)
  4. Try this http://us2.php.net/manual/en/function.session-cache-expire.php
  5. Here try this little function I just wrote for you. <?php $string = "Blah blah hello world =) [code]Code for you? skip a few ahah testing hehe one line "; function countLines($String = "") { $lines = array(); if( preg_match_all('#\ [code\]([^]]+)\[/code\]#i', $String, $Matchs, PREG_SET_ORDER)){ foreach($Matchs AS $Match) { $test = explode("\r\n", $Match[0]); if($test[0] == ' ') { array_shift($test); } if($test[count($test)-1] == ' ') { array_pop($test); } $lines[] = count($test); } } return $lines; } var_dump(countLines($string)); ?> [/code]
  6. You can do this many ways. Ill just give you some methods. Method 1: Cookies. I dont reccomend this because if a browser dont have cookies enable then it wont work... Method 2: Sessions Page not allowed to redirect <?php session_start(); if($_SESSION['is_redirected'] != true) { die("You have to be redirected to this page."); } ?> and on the other pages add <?php session_start(); if(! isset($_SESSION['is_redirected'])) { $_SESSION['is_redirected'] = true; } ?> Method 3: Check if the referer is empty? $_SERVER['HTTP_REFERER'] I also don't recommend this way either.
  7. For the ffmpeq people have compiled it for windows but the real creator has not tried them. http://ffmpeg-php.sourceforge.net/ He gives a link to this page http://groups.google.com/group/ffmpeg-php/browse_frm/thread/7734efada7b2f355/df3510343804aa02?hl=en#df3510343804aa02 Download: http://azzerti.free.fr/php_ffmpeg_win32.zip I havent tried this but I hope it helps. For your second question there are always risks running a server. The best way to protect yourself is not to open it. Get a real web host and or just keep it on localhost would be my suggestions.
  8. Cool but may I ask what would be your example mysql query to that?
  9. If I understand correctly I think this is what you want to do. Find: array_push($previouslyviewed, "$current_id"); Replace with: array_push($_SESSION['viewed'], "$current_id"); Is that what you wanted to do?
  10. Hello. I was wondering which would be the best method of doing a parent / child listing. Ive seen a few different ways in my coding time. One was to use a function that will use a query each time. I would like to do it with one query. (I got one query to work a very long time ago, but it got lost over time). Ive seen the left and right way. Im not a big fan on that one. So at the moment im trying to work with this type of database setup ID | parentID | title Anyone got any suggestions or how I should attempt them? Thanks, Preston *note - Can be more then one child =)
  11. Hey dude thanks i see what you mean. I never thought of doing it that way. SQL Now: [code]SELECT t.id AS tid,t.*,p.id AS pid,p.*,a.id AS aid,a.username AS ausername,a.*, ap.id AS apid, ap.username AS apusername, ap.* FROM topics AS t INNER JOIN posts AS p ON t.post_id=p.id JOIN accounts AS a ON t.owner = a.id JOIN accounts AS ap ON p.post_owner = ap.id WHERE t.board_id=$board[bid] ORDER BY t.date DESC LIMIT $start,$limit[/code] lol 2 inner joins and rename them :D tyz  :P
  12. Well now how do i get the 2 account username from the 2 IDs. (t.owner and p.post_owner) something like that i forgot im not looking at it :P thanks EDIT - Snapped pciture. Wanna replace the thing circal with the user's username. (Topics  Owner  Replies  Views  Last Action is the order) [attachment deleted by admin]
  13. Hello guys here :P Ok i got 3 tables to grab info. topics, post, and accounts. Well in tables i need to grab 2 diff account rows. Im doing this in one query using inner,left, and right join. Im having trouble grabbing 2 rows from accounts. Query: SELECT t.id AS tid,t.*,p.id AS pid,p.*,a.id AS aid,a.* FROM topics AS t INNER JOIN posts AS p ON t.post_id=p.id INNER JOIN accounts AS a ON t.owner=a.id AND p.post_owner=a.id WHERE t.board_id=$board[bid] ORDER BY t.date DESC LIMIT $start,$limit I really dont know how to match owner (its an id of accounts) and post_owner (id from accounts) to replace with the account username where it matchs. Can you, if soo please help. (I never had to do this b/4 :D)
×
×
  • 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.