More on strings

From: Date: Tue, 20 Mar 2001 08:15:03 +0000
Subject: More on strings
Groups: php.db 
Request: Send a blank email to php-db+get-7629@lists.php.net to get a copy of this message
I thought I had it but I didn't! I can only get LIKE to perform queries that allow me use the result for a subsequent query but for accuracy, I need to use actual values. The first statement below works OK (at least I get a Resource id #) - courtesy of help received here - but will not return $pcodeid from the third statement - it dies giving me "No pcodeid". Using the LIKE version (second one below) works fine and I can use the $pcodeid array elements as I like. Any thoughts gratefully received. $resultp = mysql_query("select Primaryid from primarycodes where Code = '".$row['Primaryexpertise']."'") or die (mysql_error()); $resultp = mysql_query("select Primaryid from primarycodes where Code like '%$row[Primaryexpertise]%'") or die (mysql_error()); $pcodeid = mysql_fetch_array($resultp) or die("No pcodeid"); Regards Mick Lloyd mjl@consultingrooms.com Tel: +44 (0)1684 560224

« previous php.db (#7629) next »