Jump to content

Ferenc

Members
  • Posts

    94
  • Joined

  • Last visited

    Never

Posts posted by Ferenc

  1. http://us2.php.net/manual/en/function.exif-read-data.php

    [code]<?php
    echo "test1.jpg:<br />\n";
    $exif = exif_read_data('tests/test1.jpg', 'IFD0');
    echo $exif===false ? "No header data found.<br />\n" : "Image contains headers<br />\n";

    $exif = exif_read_data('tests/test2.jpg', 0, true);
    echo "test2.jpg:<br />\n";
    foreach ($exif as $key => $section) {
      foreach ($section as $name => $val) {
          echo "$key.$name: $val<br />\n";
      }
    }
    ?> [/code]
  2. fill in your db info correctly and this will work

    [code]<?php
    for ($i = 'A'; $i != 'AA'; $i++){
    echo "<a href = \"?search=$i\"> $i </a>";
    }
    if(isset($_GET['search']) && $_GET['search'] != ''){
    // connect to db
    $db  = mysql_connect('localhost', 'user',  'pass') or die(mysql_error());
    $dbi = mysql_select_db('db_name', $db) or die(mysql_error());
    $search = $_GET['search'];

    $sql = mysql_query("SELECT * FROM table_name WHERE table_row LIKE '$search"."%'") or die(mysql_error());
    while ($row = mysql_fetch_array($sql)){
    // display results
    echo "<br />" .$row['row to display']. "<br />";
    }
    }
    ?>[/code]
  3. The backticks where addressed in posts previous to mine.

    Since the query was placed in the variable it cannot execute until called.
    [code]if (!$result) {
      die('Invalid query: ' . mysql_error());
    }[/code]

    My question to Grega, does the page display an error?

    If it does, the query is executed, and the backticks cause the problem.
  4. As far as I can tell Your code never executes the query.

    [code]$result = mysql_query($query) or die(mysql_error());[/code]

    change to [code]mysql_query($query) or die(mysql_error());[/code]

    If you need $result you will have to call the query in a if statement, or some other manner
  5. [code]

    <?
    if (isset($_POST['submit_data']))
    {

      // process data

      echo "Test completed!";

      //  end the script
      exit;
    }
    // display form if submit_data was not set
    ?>

    <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">...........[/code]
  6. the easiest method to send sms is basic email.

    You would need to know the service provider for the person you want to message.

    AT&T Wireless number@mmode.com               http://www.mymmode.com/messagecenter/
    Cingular          number@mobile.mycingular.com  http://www.cingular.com/sendamessage
    Nextel            number@messaging.nextel.com http://messaging.nextel.com/
    Qwest            number@qwestmp.com         http://www.qwestmp.com/
    Sprint PCS      number@messaging.sprintpcs.com  http://messaging.sprintpcs.com/
    T-Mobile        number@tmomail.net               http://www.t-mobile.com/messaging/
    Verizon          number@vtext.com                 http://www.vtext.com/

    The problem you will run into would be replys.
  7. [quote]  1. PHP has a low barrier to entry.
      2. PHP costs nothing to deploy commercially.
      3. PHP has all of the documentation needed to learn it efficiently and correctly.
      4. PHP has a universally recognized certification for professionals.
      5. PHP has a track record of success in all scales of successful enterprises (even if those enterprises don’t like to admit it).

    PHP 4 was certainly at least as effective as ASP 3-4, JSP, Cold Fusion and Perl.[/quote]

    Here are some links to a few case studies...
    [url=http://phplens.com/phpeverywhere/node/view/15]http://phplens.com/phpeverywhere/node/view/15[/url]
    [url=http://www.zend.com/zend/cs/#CaseStudies]http://www.zend.com/zend/cs/#CaseStudies[/url]
  8. You need to echo $options_t within the while loop.

    while ($row=mysql_fetch_array($result)) {
        $id=$row["id"];
        $value=$row["Type"];
        echo "<OPTION VALUE=\"$id\">".$value.'</option>';
    }


    why it doesn't display the first record is because $options_t changes with each query ( 2 entries in the database = 2 queries) . when not displayed within the loop it has to display the last result
  9. $sql = "SELECT * FROM members";
    $result = mysql_query($sql)or die (mysql_error());
    // get the total
    $total = mysql_num_rows($result) or die (mysql_error());
    // get a random id from the data base..

    // begin for loop
    for($i = 0; $i < 5 ;$i++){
    $rand = rand(1,$total);
    $sql .= " WHERE ID = '$rand'";

    $rand_sql = mysql_query($sql) or die (mysql_error());
    while ($output = mysql_fetch_array($rand_sql)){
    echo $output['membername']."<br>";
    echo $output['location'];

    }
    // end for loop
    }
  10. [!--quoteo(post=386059:date=Jun 20 2006, 09:46 AM:name=ben_stringer)--][div class=\'quotetop\']QUOTE(ben_stringer @ Jun 20 2006, 09:46 AM) [snapback]386059[/snapback][/div][div class=\'quotemain\'][!--quotec--]
    hah ill try that thanks m8
    exelent thnaks you just one last thing how can i do it so it dose it 5 times??

    selects the random id 5 times and echos all 5 results?
    thanks -ben
    [/quote]


    place it in a for loop

    for($i = 0; $i < 5 ;$i++){

    //code to display 5x
    }
  11. Something like this would work, as long as the id's are numerical, and don't have gaps in them (1,2,5,6 will error periodicly).

    [code]<?php
    $sql = "SELECT * FROM members";
    $result = mysql_query($sql)or die (mysql_error());
    // get the total
    $total = mysql_num_rows($result) or die (mysql_error());
    // get a random id from the data base..
    $rand = rand(1,$total);
    $sql .= " WHERE ID = '$rand'";

    $rand_sql = mysql_query($sql) or die (mysql_error());
    while ($output = mysql_fetch_array($rand_sql)){
        echo $output['membername']."<br>";
        echo $output['location'];
        
    }
    ?>[/code]
×
×
  • 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.