Unknown column 'customer' in 'on clause'

Overzicht Reageren

Sponsored by: Vacatures door Monsterboard

Ibrahim A

Ibrahim A

08/11/2013 16:10:10
Quote Anchor link
Beste programmeurs,

Ik heb zelf een factuur script voor mijn bedrijf, nu ik een beetje kennis heb van PHP (met name manipuleren van huidige bestanden) en de programeur van het script niet meer bereikbaar is, had ik besloten het script zelf uittebreiden met een offerte overzicht.
Dit werkt precies hetzelfde als de factuur script, alleen gebruikt het een andere tabel.

Samen delen ze wel het tabel 'costumer'.

Ik krijg nu een error:
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
6
7
A Database Error Occurred

Error Number: 1054

Unknown column 'customer' in 'on clause'

SELECT idofferte,noofferte,CONCAT(namecustomer,' ',lastname) customer,DATE_FORMAT(dateofferte,'%d/%m/%Y')dateofferte,(SELECT SUM(pu*duration) FROM service2 WHERE offerte=idofferte)subtotal,discount,btw,transport,material FROM offerte INNER JOIN customer ON idcustomer=customer WHERE 1=1 ORDER BY CAST(SUBSTR(noofferte,9) AS UNSIGNED) DESC LIMIT 0,25


Het orginele stukje script:
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
6
    function ilist( $start = 0, $limit = 25, $pattern = '' ) {
        $where = 'WHERE 1=1';
        if( '' != $pattern )
            $where .= " AND namecustomer LIKE '$pattern%' OR lastname LIKE '$pattern%'";
        return $this->db->query( "SELECT idinvoice,noinvoice,CONCAT(namecustomer,' ',lastname) customer,DATE_FORMAT(dateinvoice,'%d/%m/%Y')dateinvoice,(SELECT SUM(pu*duration) FROM service WHERE invoice=idinvoice)subtotal,discount,btw,transport,material FROM invoice INNER JOIN customer ON idcustomer=customer $where ORDER BY CAST(SUBSTR(noinvoice,9) AS UNSIGNED) DESC LIMIT $start,$limit" )->result_array();
    }


En het door mij veranderde script:
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
6
    function ilist( $start = 0, $limit = 25, $pattern = '' ) {
        $where = 'WHERE 1=1';
        if( '' != $pattern )
            $where .= " AND namecustomer LIKE '$pattern%' OR lastname LIKE '$pattern%'";
        return $this->db->query( "SELECT idofferte,noofferte,CONCAT(namecustomer,' ',lastname) customer,DATE_FORMAT(dateofferte,'%d/%m/%Y')dateofferte,(SELECT SUM(pu*duration) FROM service2 WHERE offerte=idofferte)subtotal,discount,btw,transport,material FROM offerte INNER JOIN customer ON idcustomer=customer $where ORDER BY CAST(SUBSTR(noofferte,9) AS UNSIGNED) DESC LIMIT $start,$limit" )->result_array();
    }


Waar zit nu fout? Ik heb alleen overal waar 'invoice' stond, veranderd naar 'offerte'.

Alvast bedankt!

Met vriendelijke groet,
Gewijzigd op 08/11/2013 16:13:21 door Ibrahim A
 
PHP hulp

PHP hulp

08/05/2024 22:59:40
 
Obelix Idefix

Obelix Idefix

08/11/2013 16:38:38
Quote Anchor link
Ibrahim A op 08/11/2013 16:10:10:
Waar zit nu fout?


Het antwoord staat in je post:
Ibrahim A op 08/11/2013 16:10:10:
Unknown column 'customer' in 'on clause'
 
Ibrahim A

Ibrahim A

08/11/2013 17:03:02
Quote Anchor link
Obelix en Idefix op 08/11/2013 16:38:38:
Ibrahim A op 08/11/2013 16:10:10:
Waar zit nu fout?


Het antwoord staat in je post:
Ibrahim A op 08/11/2013 16:10:10:
Unknown column 'customer' in 'on clause'


Heel erg bedankt voor je reactie!

Precies, maar ik bedoelde; wat betekend het?
Hoe kan ik het oplossen?
Gewijzigd op 08/11/2013 17:03:22 door Ibrahim A
 



Overzicht Reageren

 
 

Om de gebruiksvriendelijkheid van onze website en diensten te optimaliseren maken wij gebruik van cookies. Deze cookies gebruiken wij voor functionaliteiten, analytische gegevens en marketing doeleinden. U vindt meer informatie in onze privacy statement.