MySQL Forums
Forum List  »  Microsoft Access

SQL & substring function
Posted by: Robert Tulloch
Date: April 07, 2018 07:03PM

Odd situation:

This works fine stand alone test in php MyAdmin SQL:
select concat(substring(forename, 1,1),'bwm' ,substring(lastname, 1, 1)) from users where user_id = 152;

Output WbwmW for example.

However when same code included as parameter for placeholder:

Error Warn Log:

[Sat Apr 7 19:13:06 2018] update_tables.cgi: insert statement = 'insert into users (user_id,username,password,pin,position,forename,lastname,business,address1,address2,city,state,zip, email, phone_home, phone_cell, MJ, MD, DD, DP, comments) values ((SELECT AUTO_INCREMENT FROM information_schema.TABLES WHERE TABLE_SCHEMA=DATABASE() AND TABLE_NAME='users'),CONCAT('bwm', (SELECT AUTO_INCREMENT FROM information_schema.TABLES WHERE TABLE_SCHEMA=DATABASE()AND TABLE_NAME='users')), ?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)' at update_tables.cgi line 973.


$value = $sth->execute ($password_1, (select concat(substring($forename_1, 1,1),'bwm' ,substring($lastname_1, 1, 1))), $position_1, $forename_1, $lastname_1, $business_1, $address1_1, $address2_1, $city_1, $state_1, $zip_1, $email_1, $phone_home_1, $phone_cell_1, $MJ_1, $MD_1, $DD_1, $DP_1, $comments_1) or die "Unable to execute query: " . $sth->errstr;


[Sat Apr 7 19:13:06 2018] update_tables.cgi: Undefined subroutine &update_tables::substring called at update_tables.cgi line 979.

Undefined subroutine. Strange.

Options: ReplyQuote


Subject
Views
Written By
Posted
SQL & substring function
1759
April 07, 2018 07:03PM
875
April 07, 2018 08:43PM
914
April 08, 2018 08:20AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.