Jump to content

taquitosensei

Members
  • Posts

    676
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by taquitosensei

  1. You could try this $resulta=($result<1)?0:$result;
  2. What happens if you run your ffmpeg command on the command line? That would be the first thing to check. If that works then it's probably an issue with permissions for php creating the file.
  3. Then you need to explode it before you do this. foreach ($var_hook as $id) { $series[$id] = array(); } It's a string because you imploded it before your sql.
  4. or "SELECT * FROM data WHERE data_id IN (".implode(",", $var_hook).") ORDER BY time_id ASC"
  5. This will substract two dates and give you the difference in hours/minutes. Like DaveyK said if you add 7 days to a timestamp then subtract the original timestamp from it. You will always get exactly 7 days. $diff = strtotime($timestamp2) - strtotime($timestamp1); $hours = floor($diff / 3600); $diff %= 3600; $minutes = floor($diff / 60);
  6. You can do print_r($_REQUEST); at the top of phpdoc.php to see what kind of values are actually being posted. If you do that you should be able to see right away why this isn't working.
  7. It looks like you're not selecting the size. SELECT Food,Calories FROM food order by Food
  8. How permanent do you want it? If it's permanent permanent I would store it in a database somewhere. If it's just somewhat permanent, since you're already using jQuery, use jQuery.ajax to post to server and store a session variable. Then use that session variable to determine whether it's dead or not when initially loading the page.
  9. It does effect the query. Because in first query the value you're getting is '' The second query you're getting a number.
  10. As far as I know UNION removes duplicate rows, so the count(distinct contactid) in the second part would make it not a distinct row. So in your query you're getting everything, then everything with activity in the last week.
  11. use a double $$ $$row[0]="n";
  12. Did you install the php drivers? http://www.microsoft.com/en-us/download/details.aspx?id=20098
  13. Also to make this cleaner you could do something like this $fields=array("objava","vpr01","vpr03","etc"); foreach($fields as $field) { if(isset($_POST[$field])) { fwrite($fh, $_POST[$field]."\r\n"); } }
  14. you're outputting a blank line before the session start which starts the headers so then your session start can't start.
  15. pear is a set of php files. If your web server can parse php files then you can use pear. It's just not in the default location for the operating system. Just upload the "pear" folder from your local machine to the web server. Then set the include path. Then call the files as normal.
  16. why can't you use pear? You should be able to just put your pear directory tree in an includes folder and include the files you need. For example if on your local system pear is in /usr/share/pear or something like that, and your web root is /var/www/vhosts/yourwebsite.com put the pear folder in /var/www/vhosts/yourwebsite.com/includes/ then set the include path ini_set("include_path",$_SERVER['DOCUMENT_ROOT']."/includes/".PATH_SEPARATOR.$_SERVER['DOCUMENT_ROOT']."/includes/pear/".APATH_SEPARATOR.ini_get("include_path"));
  17. echo it out to make sure it looks right $sql="insert into gallery ('imgpath') values ('$filename')"; echo $sql; // this will show if there's something obvious causing a problem $result=mysql_query($sql); print_r($result); //this will tell you if there's actually an error with the syntax
  18. You probably have an auto increment value in your table and if you don't list the fields it uses all fields including the auto increment. You'll need to specify your fields. mysql_query("insert into $rekrytering(field1,field2,field3) values ('" . $recruit . "', '" . $nyttidn . "', '" . $datum . "')")
  19. I made a typo and was mixing up mysql and mysqli it should be while($row=mysqli_fetch_assoc($result)) { }
  20. change this // Fetch the results. $row = mysqli_fetch_array($result); // Print the results: $output[] = '<ul>'; $output[] = '<li>'.$row['title'] .': £'.$row['price'].'<br /><img src="'.$row['img'].'" alt="'.$row['title'].'" /></li>'; $output[] = '</ul>'; echo join('',$output); to this $result=mysqli_query($dbc,$query); while($row = mysql_fetch_array($result, MYSQL_ASSOC)) { $output[] = '<ul>'; $output[] = '<li>'.$row['title'] .': £'.$row['price'].'<br /><img src="'.$row['img'].'" alt="'.$row['title'].'" /></li>'; $output[] = '</ul>'; } echo join('',$output);
  21. You don't change the name of the include file. That way all you have to do is edit the single include file to add/edit/remove an include. Plus auto including files in a folder could be a big security risk.
  22. this line $target_path = $target_path . time() . '_' . basename( $_FILES['file']['name']); adds a timestamp to the beginning of the filename should be $target_path = $target_path . basename( $_FILES['file']['name']);
  23. try this. increment a variable then check the remainder e.g. $a=3; $a%3==0; echo ($a%3==0)?"<br>":""; $a=0; while($row = mysql_fetch_array($fetchdata)) { $id = $row['id']; $image = $row['awImage']; $link = $row['link']; $description = $row['description']; $fulldescription = $row['fulldescription']; $price = $row['price']; echo (($a%3)==0)?"<br>":""; echo "<div class='productpagemenu'> <div class='productpagedescription'> <center> <a href='$link' target='_blank' >$description</a> </center> </div> <div class='productpageimage'> <center> <a href='$link' target='_blank'><img src='$image' width=\"95%\"/></a> </center> </div> <div class='productpageprice'> <center> <center>&#38;#163; $price</center> </center> </div> <div class='productpagepricebutton'> <center> <center><a href='$link' target='_blank' ><img src=/images/buybutton.png /></a></center> </center> $i </br> </div> </div>"; $a++; }
  24. the last else only shows if no search term was entered. Try this. $result = mysql_db_query("cookuk_pn", $query); if(mysql_num_rows($result)==0) { echo "Your query returned 0 Results"; } else if ($result) { echo "Your output." }
  25. have a php page with all your includes then include that page at the top of each page that needs them phpincludes.php include('page1.php'); include('page2.php'); include('page2.php'); // etc then include('phpincludes.php');
×
×
  • 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.