I've got a problem, i want to echo some images depending on the $id, however for me to get that id i have to extract it from a query. So i've done that, but i want to extract all id's (not just 1), so i can echo images for all them ids (not just echo the images based on 1 id), so I did a while() loop, however doesnt seem to work
My code:
Code: <?php
include "connect.php";
$user = "Peter";
$sql = mysql_query("select * from game_main where user = '$user'");
while($row = mysql_fetch_array($sql)){
$id = $row['id'];
}
//do i have to do foreach $id as something??
$views = mysql_num_rows(mysql_query("SELECT userip FROM game_views WHERE sub_id = '$id'"));
$sql3 = mysql_query("select monthstamp from game_monthlyfeatured where first = '$id'");
$num3 = mysql_num_rows($sql3);
$sql4 = mysql_query("select weekstamp from game_weeklyfeatured where first = '$id'");
$num4 = mysql_num_rows($sql4);
$sql5 = mysql_query("select daystamp from game_dailyfeatured where first = '$id'");
$num5 = mysql_num_rows($sql5);
$sql6 = mysql_query("select date from site_featured where id = '$id'");
$num6 = mysql_num_rows($sql6);
if($num3 == 1) {
?>
<img src="../images2/game/game_awards_1monthly.gif" width="20" height="20" />
<?php
}
if($num4 == 1) {
?>
<img src="../images2/game/game_awards_topweekly.gif" width="20" height="20" />
<?php
}
if($num5 == 1) {
?>
<img src="../images2/game/game_awards_topdaily.gif" width="20" height="20" />
<?php
}
if ($views > 1000) {
?>
<img src="../images2/game/game_awards_1000views.gif" width="20" height="20" />
<?php
}
if ($views > 25000) {
?>
<img src="../images2/game/game_awards_25000views.gif" width="20" height="20" />
<?php
}
if ($num6 > 0) {
?>
<img src="../images2/game/game_awards_modpick.png" width="16" height="16" />
<?php
}
?>
Hope someone can help, thanks
True way to see if action was successful?
If this is a good way to see if action was successful to continue:Code: function changeGameState($GameId) { mysql_query("UPDATE challenges SET status=status+1 WHERE id='$GameId'");
a very simple php header question (sorry!)
Firstly...I do apologise if this annoys anyone....a header errorI'm do not know php & have tried removing all "white space" but I cant seem to stop the error displaying.Its a very
PHP not creating file.
Its supposed to create a .ini file in the /scriptfiles/users/ with the name they entered into the field then its supposed to create a password in the file in md5 encryption like this
Problem with creating FI documents
Hi, Experts!
Progress bar tracking file downloads
Hey guys, was wondering if there was a way to track how far a file has been downloaded. I know there is a way to track uploading with APC and php 5.2 + ?? any suggestions thanks
Install page
How do I make it so when a user submits information on the Install page, it'll right it into the correct file. I can do the forms and $_POST, but I need it so that it actually works.Current stuff in
Help building / using array
First - this is a cross-posting, if this is wrong I apologise! What started out as a MySQL query question (original post http://www.phpfreaks.com/forums/index.php/topic,273323.0.html) has become a PHP
Unable to customise toolbar in FCK
<FCKeditorV2:FCKeditor ID="FCKQuesreply" runat="server" ToolbarSet="MyToolbar" BasePath="~/fckeditor/" SkinPath="skins/silver/" CustomConfigurationsPath="~/fckeditor/fckconfig.js"
Auto fill in input value based on User_ID
Hello,I'm looking form some input on the following problem.User loads page -> page loads values from database and inputs them in boxes -> user edits input boxes -> new values
Baffled by Undefined Index in Simple Array: Please Help!
Hello. I have a form which posts an array to this script. However, I can't seem to access the values in the array; I keep getting an undefined index. Something is not right, but the code is so simple!