Markbhai Posted November 8, 2013 Share Posted November 8, 2013 I am trying to determine which invoice type to print from my database, in order to set the correct template, one companies invoices start with a 'Y' whilst the others starts with a 'R' e.g.RM0002 I am therefore trying to use substr to dtermine which company the invoice belongs to (my database does not support 'company name'). The database field is invoice->invoice_number so my code is elseif substr(($invoice->invoice_number),0,1) == R { ...rest of loop Can anyone see what I am doing wrong? Thanks M Link to comment https://forums.phpfreaks.com/topic/283708-trouble-with-substr/ Share on other sites More sharing options...
Barand Posted November 8, 2013 Share Posted November 8, 2013 The R should be in quotes == 'R' Putting a customer id in the invoice table would have been a better idea Link to comment https://forums.phpfreaks.com/topic/283708-trouble-with-substr/#findComment-1457470 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.