Jump to content

pgrevents

Members
  • Posts

    84
  • Joined

  • Last visited

    Never

Everything posted by pgrevents

  1. hi thanks for that but it displays the whole database but in date order is there away to show just the last seven days?
  2. well i dont get a response from the perl script without the php i have tried the perl in place
  3. Ok what I am trying to do is send an argument to a perl file to execute im making headway but there is an error here is my code <? php shell_exec('/usr/bin/php get_iplayer --info > testfile.txt'); ?> The error is getting printed to a text file thats what the > testfile.txt is the error is X-Powered-By: PHP/5.2.8 Content-type: text/html <br /> <b>Parse error</b>: syntax error, unexpected T_STRING in <b>/home/steve/public_html/get_iplayer/get_iplayer</b> on line <b>1610</b><br /> No only when I put the /usr/bin/php in the shell_exec do I get any printout whatsoever. I know this script works as I use putty to print that command is there anything on the php side to eliminate this. I think the reason it does error is cause of the usr/bin/php but thats the only line that will make the script react to anything outside shell
  4. I have another field time added which is formated like this 0 days 0 hours ago (1245170580) would there be a way of showing all up to 7 days 0 hours ago (Rand)
  5. Sorry to be such a pain with this im a newbie the changed code thows back another error == ) ORDER BY expiry DESC LIMIT 1' at line 1
  6. are you setting your session is $_SESSION['sessionname'] = $stuffvar have you tried printing your session to see if it is infact working but its your other code that isnt?
  7. Thanks for that I have tried implamenting that ill show you my code; <?php $query = mysql_query("SELECT * from programme ORDER BY expiry DESC WHERE expiry > (curdate(), INTERVAL 1 WEEK)") or die(mysql_error()); if(empty($query)){ print "NOT VALID"; } while($row=mysql_fetch_array($query, MYSQL_ASSOC)){ ?> <?=$row['pid']?><br/> Expiry : <?=$row['expiry']?><br/> <hr> <? } ?> This throws back an error which is 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 'WHERE expiry > (curdate(), INTERVAL 1 WEEK)' at line 1
  8. This field is an expiry field and well each item is 30 days so how would I refine to show the last entries in 7 days
  9. I have a datetime stamp in my database how would I order only the last 7 days entries? thanks Paul
  10. silly question but is session_start(); at the top of all your pages?
  11. but the field is there i have pulled from it before. What I am needing is to sort in lets say the last 7 days
  12. im pulling it from an autogenerated file from a 3rd party so no control over it
  13. this field has 2009-06-15T16:24:00Z in it
  14. but 2009 is Y- 06 is month m- and day is -d same for the hours
  15. can i change it to that? i parsed all the information froma text file into the db
  16. I have a field which I am trying to sort to show the last seven days and I have hit a stubmling block can anyone help please <?php $date =date('Y-m-d'); $time = date('h:i:s'); $query = mysql_query("select * FROM programme WHERE expiry <='$dateT$timeZ' "); ?> The field expiry all content is like this 2009-06-15T16:24:00Z Now the code executes but its not showing what I am wanting its showing the fields that are empty is there anyway to make this to work
  17. something like this? <a href="http://www.bragdisc.com/OBC/<?=$LeadID?> = <?=$_GET['LeadID']"?> target="_blank">Click here</a>
  18. Right i have stripped all that down to this and I have got this so far <?php <?php shell_exec('$get_iplayer --info > output.txt'); ?> The output.txt file is being created but I am trying to pass the command info to it ????
  19. actualy not solved here is the php code how do i now run and put the command through it? <?php //$poc = shell_exec("cd /../cgi-bin/net; ./excalc.pl php where=$_REQUEST[where]"); //$parms = explode("&",$poc); //$command = $_SERVER[DOCUMENT_ROOT].'/public_html/get_iplayer/get_iplayer.pl --info > testinfo.txt'; $var2 = 'get_iplayer/get_iplayer.pl'; print $var2 ."<br />"; $var3 = 'get_iplayer > test1.txt'; $var4 = $var2 .",".$var3; if(virtual(`$var2, $var3`)){ print "<br /> <p style=\"font-size:24px; color:#900; text-align:center;\">If you see this the file has executed and passed the variable</p>"; } else{ print "Error not executed"; } ?>
  20. All i need for php is to run the file i dont need anything returned any ideas. Everything I have tried so far fails cheers
  21. How would I go about getting a mysql Select query to search by letter for example I am searching the a field called titled and lets say I only want to search by their first letter lets say i have two titles; Alpha Bravo I only want to see the Bravo so the SELECT would be defined by B how would I go about this. thanks Paul
  22. can you see anything wrong with this? I have tried everything and it will not insert I have double checked spelling and everything i execute this code. The database connection is above the top if . <?php if(mysql_connect($dbhost, $dbuser, $dbpass)){ print "Mysql Connected <br/><br/><br/><br/>"; } else{ print"Mysql Not Connected <br/><br/><br/><br/>"; } mysql_select_db($dbname); $filename = 'info.txt'; $entry = null; foreach(file($filename) as $line){ //Split the data $parts = preg_split('/\s*:\s*/',trim($line),2); //Skip Blank Lines if(count($parts) !== 2) continue; if(is_numeric($parts[0])){ //New Entry if(is_array($entry) && count($entry)) addEntry($entry); $entry = array(); }elseif(is_array($entry)) $entry[strtolower($parts[0])] = $parts[1]; } if(is_array($entry) && count($entry)) addEntry($entry); function addEntry ( $entry ) { $availiable = "{$entry['available']}"; $catagories = "{$entry['categories']}"; $channel = "{$entry['channel']}"; $description = "{$entry['desc']}"; $duration = "{$entry['duration']}"; $episode = "{$entry['episode']}"; $expiry = "{$entry['expiry']}"; $epiry_relative = "{$entry['expiryrel']}"; $first_broadcast = "{$entry['firstbroadcast']}"; $index = "{$entry['index']}"; $last_broadcasted = "{$entry['lastbroadcast']}"; $title_long = "{$entry['longname']}"; $mode = "{$entry['modes']}"; $mode_size = "{$entry['modesizes']}"; $title_name = "{$entry['name']}"; $player_url = "{$entry['player']}"; $pid = "{$entry['pid']}"; $thumbnail = "{$entry['thumbnail']}"; $time_added = "{$entry['timeadded']}"; $type = "{$entry['type']}"; $version = "{$entry['versions']}"; $ultimate_url = "{$entry['web']}"; if(mysql_query("INSERT INTO programme (availiable, catagories, channel, description, duration, episode, expiry, expiry_relative, first_broadcast, index, last_broadcasted, title_long, mode, mode_size, title_name, player_url, pid, thumbnail, time_added, type, version, ultimate_url) VALUES ('$availiable', '$catagories', '$channel', '$description', '$duration', '$episode', '$expiry', '$expiry_relative', '$first_broadcast', '$index', '$last_broadcasted', '$title_long', '$mode', '$mode_size', '$title_name', '$player_url', '$pid', '$thumbnail', '$time_added', '$type', '$version', '$ultimate_url', ")){ print "Success"; } else{ print "Error Not Entered"; } } ?> this is the output i get Mysql Connected <br/><br/><br/><br/><br /> <b>Notice</b>: Undefined index: expiry in <b>G:\queue\parse.php</b> on line <b>40</b><br /> <br /> <b>Notice</b>: Undefined index: expiryrel in <b>G:\queue\parse.php</b> on line <b>41</b><br /> <br /> <b>Notice</b>: Undefined index: player in <b>G:\queue\parse.php</b> on line <b>49</b><br /> <br /> <b>Notice</b>: Undefined variable: expiry_relative in <b>G:\queue\parse.php</b> on line <b>86</b><br /> Error Not EnteredError Not EnteredError Not EnteredError Not EnteredError Not EnteredError Not EnteredError Not EnteredError Not EnteredError Not EnteredError Not EnteredError Not EnteredError Not EnteredError Not EnteredError Not EnteredError Not EnteredError Not EnteredError Not EnteredError Not EnteredError Not EnteredError Not EnteredError Not EnteredError Not EnteredError Not EnteredError Not EnteredError Not EnteredError Not EnteredError Not EnteredError Not EnteredError Not EnteredError Not EnteredError Not EnteredError Not EnteredError Not EnteredError Not EnteredError Not EnteredError Not EnteredError Not EnteredError Not EnteredError Not EnteredError Not EnteredError Not EnteredError Not EnteredError Not EnteredError Not EnteredError Not EnteredError Not EnteredError Not EnteredError Not EnteredError Not EnteredError Not EnteredError Not EnteredError Not EnteredError Not EnteredError Not EnteredError Not EnteredError Not EnteredError Not EnteredError Not Entered<br /> <b>Notice</b>: Undefined index: expiry in <b>G:\queue\parse.php</b> on line <b>40</b><br /> <br /> <b>Notice</b>: Undefined index: expiryrel in <b>G:\queue\parse.php</b> on line <b>41</b><br /> <br /> <b>Notice</b>: Undefined index: player in <b>G:\queue\parse.php</b> on line <b>49</b><br /> <br /> <b>Notice</b>: Undefined variable: expiry_relative in <b>G:\queue\parse.php</b> on line <b>86</b><br /> Error Not Entered<br /> <b>Notice</b>: Undefined index: firstbroadcast in <b>G:\queue\parse.php</b> on line <b>42</b><br /> <br /> <b>Notice</b>: Undefined index: lastbroadcast in <b>G:\queue\parse.php</b> on line <b>44</b><br /> <br /> <b>Notice</b>: Undefined index: longname in <b>G:\queue\parse.php</b> on line <b>45</b><br /> <br /> <b>Notice</b>: Undefined index: modes in <b>G:\queue\parse.php</b> on line <b>46</b><br /> <br /> <b>Notice</b>: Undefined index: modesizes in <b>G:\queue\parse.php</b> on line <b>47</b><br /> <br /> <b>Notice</b>: Undefined index: versions in <b>G:\queue\parse.php</b> on line <b>54</b><br /> <br /> <b>Notice</b>: Undefined variable: expiry_relative in <b>G:\queue\parse.php</b> on line <b>86</b><br /> Error Not Entered<br /> <b>Notice</b>: Undefined index: expiry in <b>G:\queue\parse.php</b> on line <b>40</b><br /> <br /> <b>Notice</b>: Undefined index: expiryrel in <b>G:\queue\parse.php</b> on line <b>41</b><br /> <br /> <b>Notice</b>: Undefined index: player in <b>G:\queue\parse.php</b> on line <b>49</b><br /> <br /> <b>Notice</b>: Undefined variable: expiry_relative in <b>G:\queue\parse.php</b> on line <b>86</b><br /> Error Not Entered<br /> <b>Notice</b>: Undefined index: expiry in <b>G:\queue\parse.php</b> on line <b>40</b><br /> <br /> <b>Notice</b>: Undefined index: expiryrel in <b>G:\queue\parse.php</b> on line <b>41</b><br /> <br /> <b>Notice</b>: Undefined index: player in <b>G:\queue\parse.php</b> on line <b>49</b><br /> <br /> its a large file i am trying to process and have even extended the execte time in php ini sorry to be such a pain
  23. thank you again sorry for being a pain
  24. oh to add to a database would I put the code for the database in the foreach I would try it but the text file is unbelievably large
×
×
  • 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.