Jump to content

tomjones

Members
  • Posts

    12
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

tomjones's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi. I am attempting to enable byte-range support on my Media Temple grid service account to allow playback of audio and video files from an iPhone. They suggested the following php script, but it does not provide any instructions on how to use it. Would someone be able to explain how to install this file? I've copied it to a directory as index.php, but an mp3 served to an iPhone from that directory still results in a non-specific error in the iPhone's browser. http://dev.mobi/article/content-delivery-mobile-devices I am referencing Appendix A: Streaming for Apple iPhone Thank you for your time. Tom
  2. Thanks for your reply. Would that amount of database calls be a bit resource intensive?
  3. Hi. I am creating a login component which stores a simple Y/N value in a MySQL database depending on if the login was successful or not. I need to somehow reset this to N when the user closes the browser window. What would be the best way to achieve this with PHP? I can create the sql statement, but how would I go about running a function when the window is closed? Thank you for your time.
  4. Thanks for your help guys, that works perfectly.
  5. Hi. If for example I have a variable, foo, which creates a random number,how can I pass this variable to an html page and append it to a url. An example of what I would like to achieve is: www.domain.com/file.html&foo=145365432 where the user would see file.html and file.html would receive foo=145365432 I had a similar request not long ago but was unable to extrapolate from it. Thank you very much for your attention.
  6. Hi, I have been experimenting with date and getdate. I would like to have a variable whose value is the current date, minus one hour. Could someone provide some insight into how to achieve this. Thanks.
  7. I did not see the correlation when experimenting with the above example. More specific I am trying to generate pages with custom names from an array, like www.domain.com/page.php?foo1 and www.domain.com/page.php?foo2. I Just need to know how to create these urls with php.. thanks.
  8. Hi, I would like to know how to generate pages such as www.domain.com/file.php?12345 or www.domain.com/file.php?678910. Any advice or links appreciated. Thank you.
  9. Thanks for pointing that out, i've fixed the operator but the statement does still not evaluate properly.
  10. Hi, I do not understand how to evaluate the results of a SELECT statement using php. I'm using php 4 and a mysql 5 database. I've assigned the select statement to a variable, however i need to know if the query returned any results, and run a mysql INSERT statement if the SELECT query did not return results. Below is the syntax i am using: [code] $query = mysql_query("SELECT * FROM $table WHERE Field = '$field'"); $num_rows =  mysql_num_rows($query);     return $num_rows; if($num_rows = 0)    {   $query_fail = @mysql_query("INSERT INTO $anothertable (Field) VALUES " . "('$field')");   return "error=" . mysql_error();    } else {       return "user=ok";    } [/code] When testing i noticed if i moved the mysql_num_rows below the 2nd query It executed regardless of any if statement. I believe this was the syntax: [code] $query = mysql_query("SELECT * FROM $table WHERE Field = '$field'"); if(!query)    {   $query_fail = @mysql_query("INSERT INTO $anothertable (Field) VALUES " . "('$field')");   return "error=" . mysql_error();    } else {       return "user=ok";    }   mysql_num_rows($query); [/code] Any advice on this would be appreciated. I've also researched WHERE NOT EXISTS but was unable to achieve it this way either. Thanks..
×
×
  • 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.