Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some sql queries not working with MSSQL #24

Open
Wolfsblvt opened this issue Mar 18, 2015 · 4 comments
Open

Some sql queries not working with MSSQL #24

Wolfsblvt opened this issue Mar 18, 2015 · 4 comments
Assignees
Labels
Milestone

Comments

@Wolfsblvt
Copy link
Owner

Mentioned here: https://www.phpbb.com/community/viewtopic.php?p=14003031#p14003031

The query where the error occured is here: https://github.com/Wolfsblvt/mentions/blob/master/ext.php#L91-L93

@Wolfsblvt Wolfsblvt added the bug label Mar 18, 2015
@Wolfsblvt Wolfsblvt self-assigned this Mar 18, 2015
@Wolfsblvt Wolfsblvt added this to the 1.1.0 milestone Mar 18, 2015
@bantu
Copy link

bantu commented Mar 18, 2015

Try using single quotes around SQL strings.

    $sql = 'SELECT bbcode_id
FROM ' . BBCODES_TABLE . "
WHERE bbcode_tag = 'mention' OR bbcode_tag = 'mention='";

@Wolfsblvt
Copy link
Owner Author

Thank you for that tip. Single quotation marks seems to be working for MSSQL. Let's hope it is working in all other dbms systems as well.
Thank you, @bantu.

@iMattPro
Copy link

May be better to consider using sql_in_set instead.

'WHERE ' . $this->db->sql_in_set('bbcode_tag', array('mention', 'mention='));

@Wolfsblvt
Copy link
Owner Author

Even better, agreed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants