Page 1 of 1
Problem with sql
Posted: Sun Feb 08, 2004 12:58 pm
by Citizen99
I need some good tutorial about sql. I want to make form in php/mysql and I have problems with counting I dont know how to '+' '-' '*' '/' and I want to make some stats. Anyone can help ? Know that is simple problem but i do something wrong and only erros appear..
Posted: Sun Feb 08, 2004 3:32 pm
by Illusionist
do you think you can reask your question in plain english? Because none of that made any sense to me.... And if your having problems with some code, then it's probably a good idea to post it in the thread so we can check it.
Posted: Mon Feb 09, 2004 7:14 am
by William
I think he wan'ts a tutorial for forms that can Add (+) Devide (/) Multiply (*) & Subtract (-) for some stat thing.
Posted: Tue Feb 10, 2004 1:19 pm
by Citizen99
Thx for help, I handle with my problems when all the job will be done I will post php code for pople who can have similiar problem with things conected with making stats. And maybe then someone can help me with improving my code :]
Posted: Tue Feb 10, 2004 2:51 pm
by William
Posted: Fri Feb 13, 2004 5:58 am
by Citizen99
Here is part of my code it counts how much money I win depending on how much I bet etc :] it shows for example how to multiply 2 columns and then adding results :]
Code: Select all
...
$sql="SELECT SUM(kurs*stawka) from typy where stawka=4 AND status like 'win'";
$wynik = mysql_query($sql) or die(sql_error);
while ($row = mysql_fetch_row($wynik)) {
$win=round($row[0],2);
}
$sql="SELECT SUM(stawka) from typy where stawka=4";
$wynik = mysql_query($sql) or die(sql_error);
while ($row = mysql_fetch_row($wynik)) {
$bet=$row[0];
}
$prof=($win-$bet);
print $prof;
...