Jump to content

[SOLVED] FUNCTION not quite "FUNCTIONAL"


Chezshire

Recommended Posts

I have a simple function which i've written, it does what I want and then some as it delivers the info with quotes around it which I don't want. How do i remove the quotes? I've tried a few things and nothing has worked. Help?

 

FUNCTION:

function getSquadName ($id) {
$myLogin = readDatabase("select squadronDB from cerebra WHERE id=\"$id\"");
if (!$myLogin["squadronDB"]) { return " \"$id\""; } else { return $myLogin["squadronDB"]; }
} // end FUNCTION

 

Thank you Barand,

 

I had to add some quotes in, but thanks, your guideance helped me to look at my problem from another angle!

 

This is what I did:

function getSquadName ($id) {
$myLogin = readDatabase("select squadronDB from cerebra WHERE id=\"$id\"");
if (!$myLogin["squadronDB"]) { return " $id "; } else { return $myLogin["squadronDB"]; }
} // end FUNCTION

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.