Jump to content

JasperBosch

New Members
  • Posts

    8
  • Joined

  • Last visited

    Never

Posts posted by JasperBosch

  1. Hi,

    You could try this:
    [code]
    <form name="nameOfTheForm" action="phptest1.php" method="POST">
    <input type="hidden" name="msg" value="This is the message and it would probably be too long to use GET"/>
    <a href="javascript :document.nameOfTheForm.submit();">submit</a>
    </form>
    [/code]

    (Remove the blank after 'javascript' and before ':')

  2. Hi,

    On the way you lost the } from the while loop, that's the cause of showing just one video.

    I think you don't want to declare a table for every video you dislplay. I rewrote a piece of your code:
    [code]
    ...
    $result = mysql_query($query) or die('Error, query failed'); ?>
    <div align="center">

    <table cellpadding="2" width="65%"  border="0" cellspacing="0" cellpadding="0">
    <? while($row = mysql_fetch_array($result)) { ?>
    <tr>

    <td width="50%">

    <a href="<?php echo $_SERVER['PHP_SELF'] ?>?id=<?= $row['id'];?>"><IMG BORDER="0" img src="media/thumbs/<?=$row['thumbnail'];?>" height="80" width="80"><p>

    </a></td>
    <td width="50%">

    <a href="<?php echo $_SERVER['PHP_SELF'] ?>?id=<?= $row['id'];?>"><b><?php echo $row['title'];?></b></a><br>Added on <?=$row['date'];?>
    <br>Plays: <?=$row['playcount'];?>

    </td></tr>
    <? } ?>
    </table>
    <?php

    // how many rows we have in database
    ...
    [/code]
  3. Hi,

    Is your time stored as a date or as a string?

    If it's a string you hav a BFP. (The B stands for Big and the P for Problem)
    But if it is stored as date or timestamp you can query on it. The where-statement should look like this:
    [code]
    WHERE time BETWEEN '2005-01-16' AND '2006-01-15'
    [/code]
  4. Hi,

    You mean something like this?
    [code]
    $sql ="SELECT SUM(cost + costtwo) as 'cost' FROM results WHERE resultid = '$resultid'";
    $sql = @mysql_query($total,$connection) or die(mysql_error());
    [/code]

    Yea, thats realy easy, isn't it?
  5. Hi n8w,

    Do you have any reason to use mysql_db_query instead of mysql_query?

    $cid = mysql_connect($host,$usr,$pwd); already creates a connection to your database, the mysql_db_query creates a new connection to your database and you won't use the connection you already made.
    Read the reference: [a href=\"http://www.phpfreaks.com/phpmanual/page/function.mysql-db-query.html\" target=\"_blank\"]mysql_db_query[/a] and [a href=\"http://www.phpfreaks.com/phpmanual/page/function.mysql-query.html\" target=\"_blank\"]mysql_query[/a]

    I never close a databaseconnection, it is closed on termination of the script. I think?
  6. Hi Sykoi,

    I think you try the wrong way. Why use regular expression?

    Why not use unserialize?

    I should do it this way:

    [code]
    $var = unserialize($ucashbank);
    $amount = ceil($var['amount']);
    [/code]

    This wil return the result you disire.
×
×
  • 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.