Click here to Skip to main content
14,980,646 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a large list(of string) of song titles (e.g. ~1000 titles), and I want to look them up in mysql.

I have the following code, but it gives me errors and I don't know why:
VB
Dim test As String = "alpha - bravo#charlie - delta#echo - foxtrot"  '<<test string!!not the actual list
Query = "select song FROM songs WHERE song IN ('.implode(','," & test & ").')"
command=New mysqlcommand(query,mysqlconn)
reader="COMMAND.ExecuteReader


What I have tried:

I tried different approaches but hopefully someone spots the error.
Posted
Updated 14-Mar-21 23:40pm
v6
Comments
Gerry Schmitz 13-Mar-21 13:38pm
   
Get the SQL working in MySQl admin console; then convert it to VB.

1 solution

Implode[^] is a PHP function used to join array elements with string!

I'd suggest to read this: Comma-Separated Values | Sisense[^]
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900