Wednesday, June 25, 2008

This seems simple enough but why am i unable to divide and display $ratio?

echo "<h3>Clan Statistics</h3>";
$wins = 0;
$losses = 0;
$ties = 0;
while($row = mysql_fetch_assoc($result))
{
if($row[ our_score ] > $row[ op_score ])
{
$wins += 1;
}
elseif($row[ our_score ] < $row[ op_score ])
{
$losses += 1;
}
else
{
$ties += 0;
}
}

$ratio = $wins/$losses;

echo "<h3>Record: " . $wins . "-" . $losses . "-" . $ties . "</h3>";
echo "<h3>Win/loss Ratio: " . $ratio . "</h3>";

I m curious

I ve got a PHP Guestbook on my website with the tables and database hosted by MySQL.

The PHP Guestbook defines the look- as well as how it s displayed (referencing the MySQL database).

I ve got a couple of TEST logs in the guestbook that are now viiewable on the site.

My question is- how do I manage/delete these?

It should be located SOMEWHERE on the MySQL Database right?
I assume all the data is logged there- is that correct?
If so- can you direct me as to where i should look?

Cheers guys!
Yea- I used phpMyAdmin to make the tables and stuff- but i for some stupid reason just can t find where all the data is being logged at.
I ll check again....hmmmmm

I just can t figure out what is wrong with this sql line. Any suggestions?
$sql = "SELECT Match.*
FROM Match
WHERE Match.clan_id = 1
ORDER BY dateposted DESC LIMIT 1;";

Error I am receiving:
DB connect failed: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near Match WHERE Match.id = 1 ORDER BY dateposted DESC LIMIT 1 at line 2

I seem to get these errors just with the script. Parse error: parse error- unexpected { on line 15.

The thing is I have the same script running on a Host Gator account- that registers- uploads photos and video. Godaddy sucks when it comes to hosting. It took me a while to find out how to even connect to the host using WSFTP.

I am using PHP 5 coding and I m supposed to be connected to a MYSQL 5 db. I think the MSQL version is still in 4 even though they give you the option to use 5. If anyone has any solutions reply back soon. Thanks!

hi- i m having a problem finding a Query that will do what I need to do. to simplify this question I ll go through it with this example:

id------num
1---------9
2---------10
3---------10
4---------12
5---------12

i want an output to be like : 9-10-12.
the only thing that came close to what i have searched is: "SELECT DISTINCT num FROM `random`"- but this only gives me 1 number.

can someone help me out here?
thx

locally and when ready simply upload to my server and it will be accessible and live- is there such an all in one solution?

No comments: