JasperBosch
-
Posts
8 -
Joined
-
Last visited
Never
Posts posted by JasperBosch
-
-
Hi,
I don't think your linebreaks have disappeared. They are in your contents but as the character '\n'. If you want to show your contents in HTML you have to use nl2br($contents) -
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] -
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] -
Hi,
My first gues is to remove the { and } in your sqlstatement. I think they don't belong there.
The linenumber in the errormessage is the linenumber within you sqlstatement, not your php-code. -
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? -
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?
-
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.
Submit Button
in HTML Help
Posted
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 ':')