remove mysql prefix or use cmsb without mysql prefix

5 posts by 2 authors in: Forums > CMS Builder
Last Post: July 11, 2023   (RSS)

By ht1080z - July 10, 2023

Hi,

Can I install or remove the MySQL prefix of the cmsBuilder (so I can merge later with another project).

regards,
Karls

By Dave - July 10, 2023

Hi Karls,

We haven't tested that but if you're comfortable modifying the code you could try disabling the error checking in /lib/admin_functions.php in the installIfNeeded() function

    //if     (!$_REQUEST['mysqlTablePrefix'])                          { alert("Please enter your 'MySQL Table Prefix'<br>\n"); }
    //elseif (preg_match("/[A-Z]/", $_REQUEST['mysqlTablePrefix']))    { alert("Value for 'MySQL Table Prefix' must be lowercase.<br>\n"); }
    //elseif (!preg_match("/^[a-z]/i", $_REQUEST['mysqlTablePrefix'])) { alert("Value for 'MySQL Table Prefix' must start with a letter.<br>\n"); }
    //elseif (!preg_match("/_$/", $_REQUEST['mysqlTablePrefix']))      { alert("Value for 'MySQL Table Prefix' must end in underscore.<br>\n"); }
    //elseif (preg_match("/[^a-z0-9\_\-\.]/i", $_REQUEST['mysqlTablePrefix'])) { alert("Please enter a valid 'MySQL Table Prefix' (Example: cms_)<br>\n"); }

And then deleting/renaming /data/isInstalled.php to get back to the install screen.

Maybe do a full backup first and then try to restore.

Hope that helps!

Dave Edis - Senior Developer
interactivetools.com

By ht1080z - July 10, 2023

Thank you Dave for your quick reply!

I'll give it a try.

By ht1080z - July 11, 2023 - edited: July 11, 2023

One more question:
Can I rename the Record number field from "num" to "id" with my custom tables? (probably not, that is default cmsb auto-increment...)