Chezshire Posted August 17, 2008 Share Posted August 17, 2008 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 Link to comment https://forums.phpfreaks.com/topic/120105-solved-function-not-quite-quotfunctionalquot/ Share on other sites More sharing options...
Barand Posted August 17, 2008 Share Posted August 17, 2008 perhaps return $id; instead of return " \"$id\""; Link to comment https://forums.phpfreaks.com/topic/120105-solved-function-not-quite-quotfunctionalquot/#findComment-618750 Share on other sites More sharing options...
Chezshire Posted August 18, 2008 Author Share Posted August 18, 2008 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 Link to comment https://forums.phpfreaks.com/topic/120105-solved-function-not-quite-quotfunctionalquot/#findComment-618850 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.