Philip
Staff Alumni-
Posts
4,665 -
Joined
-
Last visited
-
Days Won
20
Everything posted by Philip
-
Take a look at the forum you're wanting to switch to's forums... like for instance (it's an older topic, but first on google list) http://www.simplemachines.org/community/index.php?topic=227796.0
-
That's normal. There isn't a true boolean (in sense of true/false) in MySQL, but tinyint(1) is the same thing as 1/0 for true/false
-
I'm not sure I follow what exactly you're trying to do here... So you want to find the ranking of the ID? Why not just pull the rank column?
-
Then I would do: Table votes --------------- video_id (int) user_id (int) vote (bool) vote - 1/true for upvote, 0/false for downvote
-
Again, PLEASE use tags, you'll see why your program doesnt work with syntax highlighting: <?php $username="root"; $password=""; $database="addtransdb"; mysql_connect(localhost,$username,$password); @mysql_select_db($database) or die( "Unable to select database"); //***didn't i suggest removing the @?*** $query="SELECT * FROM addtransinfo"; $result=mysql_query($query); $num=mysql_numrows($result); mysql_close(); ?> <HTML><HEAD> <!--*** notice something wrong below? ***--> <META http<BODY><B><FONT size=+2>Project: Hammock Oaks In-house transfers & Add-ons</FONT> <FORM> <TABLE cellSpacing=0 cellPadding=0 border=1> <TBODY> <TR> <TH>Appl</TH> <TH>.</TH> <TH>.</TH> <TH>.</TH> <TH>Race &</TH> <TH>Ethnic-</TH> <TH>.</TH> <TH>Displ.</TH> <TH>Income</TH> <TH>B/r s </TH> <TH>Movein</TH> <TH>Removal</TH> <TH>.</TH> <TH>.</TH> </tr><tr> <TH>#</TH> <TH>Date</TH> <TH>Time</TH> <TH>Name</TH> <TH>Gender</TH> <TH>City</TH> <TH>LH %</TH> <TH>Y/N</TH> <TH>Level</TH> <TH>Needed</TH> <TH colSpan=2>Date</TH> <TH>Code</TH> <TH>Comments</TH></TR> </TBODY></TABLE> <?php $i=0; while ($i < $num) { if ($num==0) { echo "the database contains no contacts yet"; } else { $appl=mysql_result($result,$i,"appl"); $date=mysql_result($result,$i,"date"); $time=mysql_result($result,$i,"time"); $name=mysql_result($result,$i,"name"); $racegend=mysql_result($result,$i,"racegend"); $ethnicity=mysql_result($result,$i,"ethnicity"); $laborhsg=mysql_result($result,$i,"laborhsg"); $displ=mysql_result($result,$i,"displ"); $incomelevel=mysql_result($result,$i,"incomelevel"); $brneeded=mysql_result($result,$i,"brneeded"); $moveindate=mysql_result($result,$i,"moveindate"); $removaldate=mysql_result($result,$i,"removaldate"); $code=mysql_result($result,$i,"code"); $comments=mysql_result($result,$i,"comments"); // ***you need to close php right here*** <table> <tr> <TD><?php echo $appl; ?></TD> <TD><?php echo $date; ?></TD> <TD><?php echo $time; ?></TD> <TD><?php echo $name; ?></TD> <TD><?php echo $racegend; ?></TD> <TD><?php echo $ethnicity; ?></TD> <TD><?php echo $laborhsg; ?></TD> <TD><?php echo $displ; ?></TD> <TD><?php echo $incomelevel; ?></TD> <TD><?php echo $brneeded; ?></TD> <TD><?php echo $moveindate; ?></TD> <TD><?php echo $removaldate; ?></TD> <TD><?php echo $code; ?></TD><TD> <?php echo $comments; ?></TD> </TR> // *** then you'll need to open php again, alternatively you could use heredoc *** $i++; } echo "</table>"; $i++; } ?> </B></FORM> <P></P></BODY></HTML> I've left comments in your code prefixed with ***
-
Few things: - tags - @mysql_select_db($database) or die( "Unable to select database"); - take out the @ - turn on error reporting in PHP.
-
Let's dig a little deeper: - Do you have users --- if yes, do you want to be able force them to only vote once, or to track their average ratings? --- if no, will/do you want to in the future?
-
I would do the same thing. Plus it looks tidier IMO.
-
Dumb question, but still possible: are you saving it as the same file type? (e.g. not going from jpg -> png)
-
... proper error checking?
-
Meh, I tried the beta the first time around... I just couldn't get into it. All my friends are super excited about it though.
-
Intranet Database (Wasn't quiet sure whare to post this)
Philip replied to meltingpoint's topic in Miscellaneous
Probably because there are plenty of client-side versions of this. Just sounds like a giant excel sheet/access database to me. -
Problem with generating fixed-length randomized output
Philip replied to Aeternitas's topic in PHP Coding Help
Alternatively, pretty much the same thing: function getRandom() { $options = array_merge(range('A', 'Z'), range(0, 9)); return $options[rand(0,25)] . $options[rand(0,25)] . $options[rand(0,25)] . '-' . $options[rand(26,35)] . $options[rand(0,25)] . $options[rand(0,25)]; } -
SELECT rating, date_of_pr, pr_ID FROM performance_review pr RIGHT OUTER JOIN employee e ON pr.employee_ID = e.employee_id WHERE pr.date_of_pr = (SELECT MAX(date_of_pr) FROM performance_review WHERE employee_ID = pr.employee_ID) AND e.manager_id=".$m_id."
-
I've actually thought about getting that mouse...
-
Hmm... I wonder where you could pull more time from
-
As much as I love my PC & PS3, I'd suggest going the Xbox route... PS3 still doesn't have too many "omg-gotta-have-this-NOW!" games. And although its free to play online for ps3... I think Xbox's service is better.
-
http://www.dol.gov/whd/minwage/america.htm Don't expect many decent programmers to go for $10/hr.
-
I definitely agree with you. It is better if they send it via email. Email is very flexible and you can easily receive their message. Hey, we're only 2 years behind
-
I find it funny looking back on my past applications - "thinking man, was I stupid or what?" All part of the learning experience. Some people around here, like premiso still haven't learned (nor will they ever!)
-
Probably because it's better to get support from the third party support team first
-
Reported. I think you mean TDLR; Reported. Bump. I need THIS CODE WRITTEN URGENTLY: PLEASE WRITE ME A SCRIPT THAT I CAN UPLOAD PICTURES TO AND POST THEM ON THE INTERNET FOR FREE. THANK YOU! HALP!
-
Reported. I think you mean TDLR; Reported. Bump.