Search found 99 matches

by joecrack
Wed Nov 30, 2005 7:33 pm
Forum: Databases
Topic: SELECT with many SUMs
Replies: 2
Views: 636

Thanks for the answer - but i DONT WANT a sigle data - sry i think i didnt say that.
I want to have many SUMs and then i want to put them into an Array!!!
Ithink this command cant be put in an Array!!!
by joecrack
Wed Nov 30, 2005 2:07 am
Forum: Databases
Topic: SELECT with many SUMs
Replies: 2
Views: 636

SELECT with many SUMs

Hai i need a SELECT like this: SELECT SUM(contramount) 'Bekommen' FROM sam_date_val WHERE projnr BETWEEN '1000' AND '5000'; SUM(tovalue) 'Genommen' FROM sam_date_val Its working like this SELECT SUM(contramount) 'Bekommen' FROM sam_date_val WHERE projnr BETWEEN '1000' AND '5000'; SUM(tovalue) 'Genom...
by joecrack
Sun Nov 27, 2005 11:55 pm
Forum: Databases
Topic: special table output!!!
Replies: 3
Views: 486

plz somebody ...
just some approach ....
by joecrack
Thu Nov 24, 2005 2:38 am
Forum: Databases
Topic: special table output!!!
Replies: 3
Views: 486

so now i got a sql command like this: SELECT sum(tovalue) FROM sam_date_val GROUP BY contrdate BETWEEN DATE '$year-01-01' AND DATE '$year-01-31', contrdate BETWEEN DATE '$year-02-01' AND DATE '$year-02-30', contrdate BETWEEN DATE ................... But it makes a new rows for every group .. and i w...
by joecrack
Wed Nov 23, 2005 11:44 pm
Forum: Databases
Topic: special table output!!!
Replies: 3
Views: 486

special table output!!!

Hai i want to build a table output that is ordered like this: http://rzserv2.fhnon.de/~lg016500/untitled1.bmp (the <10, <100 etc is just an example - i want it to be seperatet by different dates) I want to fill out the blanks, but i dont know how i have to do the SELECTs. It could be done like this:...
by joecrack
Mon Nov 21, 2005 9:02 pm
Forum: PHP - Code
Topic: if command
Replies: 14
Views: 1790

so do you have any suggestions??? or do you have a good url or tutorial??? and the script is finally working ... hbut still one thing i need to know. if i updatet like this: $sql = "UPDATE sam_date_val SET tovalue=tovalue+$tovalue WHERE (projnr='$projnr' AND customernr='$customernr' AND contrda...
by joecrack
Mon Nov 21, 2005 7:48 pm
Forum: PHP - Code
Topic: if command
Replies: 14
Views: 1790

the script i haveis only available on the intranet of my firm....
do i still have to change things because of sql injections???
by joecrack
Mon Nov 21, 2005 12:15 am
Forum: PHP - Code
Topic: if command
Replies: 14
Views: 1790

nope - renamed it !!!
both "sql " now !!!
by joecrack
Sun Nov 20, 2005 11:46 pm
Forum: PHP - Code
Topic: if command
Replies: 14
Views: 1790

hmmm .. i write the same echo after both UPDATEs and its not showing me the second one....
same: echo"$sql"
and nothing at the second UPDATE ????? 8O
by joecrack
Sun Nov 20, 2005 11:17 pm
Forum: PHP - Code
Topic: if command
Replies: 14
Views: 1790

NO still same error:
server version for the right syntax to use near 'WHERE projnr='8888' AND customernr='88.88.'' at line 120
(line 120 is the second update command)
Why is it a problem to use it a second time ???
I mean it doesnt say anything about the first update!
by joecrack
Sun Nov 20, 2005 10:02 pm
Forum: PHP - Code
Topic: if command
Replies: 14
Views: 1790

No Prob there u go =) if($cortval3>0){ $tovalue=$tovalue+$cortval1+$cortval2+$cortval3; } elseif($cortval2>0){ $tovalue=$tovalue+$cortval1+$cortval2; } elseif($cortval1>0){ $tovalue=$tovalue+$cortval1; } $sql = "UPDATE sam_date_val SET tovalue=$tovalue WHERE projnr='".$_POST['projnr'].&quo...
by joecrack
Sun Nov 20, 2005 9:58 pm
Forum: PHP - Code
Topic: if command
Replies: 14
Views: 1790

hai i found the problem ... i have another if/update command before this one in the script, and if i take that one out it is working. it also has this in it: $sql = "UPDATE sam_date_val SET tovalue=$tovalue WHERE projnr='".$_POST['projnr']."' AND customernr='".$_POST['customernr'...
by joecrack
Sun Nov 20, 2005 9:27 pm
Forum: PHP - Code
Topic: if command
Replies: 14
Views: 1790

if command

hei i have this if command and its not working. the error is: server version for the right syntax to use near 'WHERE projnr='8888' AND customernr='88.88.'' at line 1 But: customernr='".$_POST['customernr']." is right- isnt it??? The whole code is: if($actdeldate>0){ $sql = "UPDATE sam...
by joecrack
Fri Nov 18, 2005 2:14 am
Forum: PHP - Code
Topic: INSERT INTO not working (PHP+MySQL)
Replies: 6
Views: 475

first always write

Code: Select all

error_reporting(E_ALL);
at the beginning of the php script - then php tells you what the problem is!!!
do the insert like this:

Code: Select all

$query = "INSERT INTO games (columname1,columname2) VALUES ('abc','123')";
by joecrack
Fri Nov 18, 2005 1:34 am
Forum: PHP - Code
Topic: two table update
Replies: 4
Views: 332

Both are integers.
So i just want to sum them together.
Yeah the if command was smurf ...-.... excuse me :roll:
BUt do you understand what i want to do.
If cortval3 has a value, then i want to add cortval1-3 to toval .. and to val is in a different table.!!!