Click here to Skip to main content
15,881,089 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I tried the below query for storing wav audio file into mySQL.

update files set sample=load_file('C:\Users\VIGNESH\Desktop\project\VRS\test2.wav') where number=789;

files is my table name,sample is my column name of datatype mediumblob and number is an another column.

when i executed the above query,it is showing as
'query ok,0 rows affected'

the audio file is not getting stored into the database.please help me...
Posted

1 solution

Refer: function_load-file[^]
Quote:
To use this function, the file must be located on the server host, you must specify the full pathname to the file, and you must have the FILE privilege. The file must be readable by all and its size less than max_allowed_packet bytes.

You have to first upload and save your wav file to a temp folder on the server, then use load_file to insert it into a mysql table.
 
Share this answer
 
v2

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