PHP help
- Started
- Last post
- 27 Responses
- determinedmoth0
dont be like that. It was kinda on topic!
- UndoUndo0
haha , sorry fifty50...glad you got it sorted
- fifty500
it's okay now I went back and rewrote most of it, taking out some useless shite and now it works fine. thanks for the help guys. you may now continue with your hijacked thread.
- UndoUndo0
looks quite well documented
- determinedmoth0
ok. Well I hope it's a little while off at the moment, but there might be some work for someone who can handle it. It could very well be beyond me.
- UndoUndo0
i had a look at php>MS SQL from what I saw it was data from linux> windows and back that was the hardest part.
unfit might be able to help
- determinedmoth0
why have you decided to go with MS SQL over MYSQL??
UndoUndo
(Nov 16 05, 01:46)Becuase it's an e-commerce site and the clients' stock systems run under Sage - which is SQL based, but MS SQL. So we've got to plug it into that.
- UndoUndo0
fifty50 try this i made a mistake
while ($row = mysql_fetch_array($result)) {
$myVar = $row['expectedVar'];}
- UndoUndo0
hi Moth,
yeah i was asking about a GUI for MS SQL but its with VB ASP and not my arena...we have another guy onto it.
why have you decided to go with MS SQL over MYSQL??
- determinedmoth0
Undo...
Was it you asking about MS SQL? We've a rather large project that will require PHP + MSSQL. Have you experience of this?
- determinedmoth0
unfortunately not. it's still taking the piss.
fifty50
(Nov 16 05, 01:30)I'm my experience PHP probably thinks you're giving it away.
- fifty500
unfortunately not. it's still taking the piss.
- UndoUndo0
while ($row = mysql_fetch_array($result)) {
&myVar = $row['expectedVar'];}
is all you need
- fifty500
well i fixed the parsing error but there's something wrong in my code:
while ($row = mysql_fetch_array($result, MYSQL_NUM)) {
}
it's giving me an error:
mysql_fetch_array(): supplied argument is not a valid MySQL result
- UndoUndo0
once a file has been included the code in the included file is just like hving it in the original file, scope is also the same. you don't need to pass variables to it. if you have a function inside the included file and you want to pass a var to it. do it with myfunction($var); and have it return something
just make sure you call the function after the file has been included!
- foreign0
try using require/require_once.
http://www.php.net/require
- fifty500
I have no clue what you guys are going on about -_-
- Anarchitect0
I'm aware of that
but I avoid using names that can conflict with any existent super global.
- justjeff0
you should add this to the beggining of your script to retrieve all $_GET/$_POST vars:
foreach ($_REQUEST as $key => $value) $$key = $value;
Anarchitect
(Nov 15 05, 10:50)That's actually a bad idea, and it's as flawed as allowing register_globals to be on in the first place.
You should only use vars from $_REQUEST, $_POST, and $_GET as you need them - pulling them globally at the start of a script can lead to very common programming bugs where an initialized variable is meant to imply a known state, and a tainted REQUEST can override privilleges.
This was the most common security hole in PHP scripts for about 2 years from 2001-2003, and caused the PHP camp to finally disable register_globals by default.
- fifty500
everything's just a bit over my head. I just know how to do simple includes and that's about it. i appreciate your help but i think i'll leave it until the morning and get someone in my office to help me.