Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

FUCKING PHP.

Name: Anonymous 2007-11-06 4:17

Alright /prog/, I'm fucking lost.

My syntax is wrong and I'm just too blind to see where.

What I want this simple lil' PHP script to do is set 2 column values, and for some reason it just won't.

if($_GET['approve']){
$item = $_GET['approve'];
mysql_query("UPDATE $table SET status='PA' num='prefix$item' WHERE id='$item'") or die(mysql_error());
mkdir("../../path/folderprefix$item", 0777);}

Is it because I can't use the WHERE clause, or is it just out of order?

DEBUGGING MODE:

UPDATE table SET status='PA' num='prefix115' WHERE id='115'

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 'num='prefix115' WHERE id='115'' at line 1

That's what I get. It's supposed to be doing what I want it to, but it seems to not want to do that.

Name: Anonymous 2007-11-06 4:19

Disregard that I suck cocks.
I missed the AND between status and num.

Name: Anonymous 2007-11-06 4:33

Disregard that disregard, the script still sucks cocks.
Now, instead of writing the specified values it's writing nothing to the num column and a zero to the status column.

Errrgh.

Name: Anonymous 2007-11-06 4:57

The grammar of a typical update is thus:

update table set column1=value1, column2=value2 where column3=value3

Name: Anonymous 2007-11-06 4:59

Why the christ is it writing a zero? :V

Name: Anonymous 2007-11-06 5:00

>>4
Check, I fixed the missing comma.. But it's just writing a zero to status, nothing to num and failing to write the directory.

Name: Anonymous 2007-11-06 5:09

>>6
Are you sure your datatypes are correct, i.e. all varchar or char and of sufficient length?

Name: Anonymous 2007-11-06 5:19

if($_GET['approve'])
Hahaha.
SET status='PA' num='prefix$item' WHERE id='$item'
HAHAHA.
mkdir("../../path/folderprefix$item", 0777);
Oh wow...

Name: Anonymous 2007-11-06 5:25

>>1

Suddenly, injections.

And, 0777. Oh lol.

Also, there's a MySQL manual. If you need syntax, it is very easy to find in the manual (somehow I think you'll need a lot more after that, though).

Fucking saged for DISCOUNT PROGRAMMERS.

Name: Anonymous 2007-11-06 10:09

OMG, there's too much to zoom in...

Line 1: Shit spacing, shit security
Line 2: Unnecessary, lack of indentation (needs more forced)
Line 3: Lack of DB abstraction, old library, SQL injection, SQL syntax error, probably stupid unnecessary quotes ('"$webmasters"' + '0' . "")
Line 4: Shit security, path injection, shit permissions

Every single line fails as hard as it possibly could. I think this is an amusing troll.

Name: Anonymous 2007-11-06 10:20

>>1
Post a link to the website so we can debug it for you.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List