[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [NETVAERK] � til SQL



Lasse Luttermann wrote:
Jeg har et problem med MySQL, det er nok nærmere med PHP!

$query = "SELECT * FROM dev_kunder WHERE 'id' LIKE '" . $_GET['stype'] .
"' AND 'navn' LIKE '" . $_GET['snavn'] . "' AND 'tlf1' LIKE '" .
$_GET['stlf'] . "' ORDER BY id ASC";

Standart værdierne for alle værdier i $_GET arrayen er '%' og output af
dette query som det skal være! men hvis jeg ændre $_GET['stlf'] til '5%'
så er der ikke længere nogen nogen resultater! hvis jeg bruger MySQL
client programmet i consolen og skriver følgende:
"SELECT * FROM dev_kunder WHERE id LIKE '%' AND tlf1 LIKE '5%' AND mail
LIKE '%';"

Får jeg de outputs jeg skal have, men ikke med den overstående sætning i
PHP!! Hvad gør jeg galt??

I dit PHP-kode sammenligner du array-indholdet med strengen 'tlf1', ikke med indholdet af feltet tlf1. Løsning: Fjern '' om feltnavnene.


Med venlig hilsen

Ole

 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-11-01, 02:01 CET [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *