Now the problem is that I want to call the function, change the parameters $query to "INSERT INTO..." and $at to 1 but leave $echoit with it's default value which is 0, and if I do this:
testquery ( "INSERT INTO...", 1 );
The 1 will be set to $echoit instead of $at.
How can I do this? (Hope you get what I mean...) :rofl:
This should be sooo basic thing to do but I've never passed through a situation like this before and I may not know all basics as I never read a book or something like that. I have learned to program by seeing other programs in action, not reading or seeing tutorials. Glad I did because now it's much easier in school. :D
Question
Swift-R
I have a question about PHP function parameters.
I have a function like this (just an example):
function testquery ( $query, $echoit = 0, $at = 0 ) { if ( $echoit == 1 ) { echo $query; } if ( $at == 1 ) { return @mysql_query ( $query ); } else { return mysql_query ( $query ); } }Now the problem is that I want to call the function, change the parameters $query to "INSERT INTO..." and $at to 1 but leave $echoit with it's default value which is 0, and if I do this:
The 1 will be set to $echoit instead of $at.
How can I do this? (Hope you get what I mean...) :rofl:
This should be sooo basic thing to do but I've never passed through a situation like this before and I may not know all basics as I never read a book or something like that. I have learned to program by seeing other programs in action, not reading or seeing tutorials. Glad I did because now it's much easier in school. :D
Link to comment
Share on other sites
2 answers to this question
Recommended Posts