Doing a university course in web development and I’ve been sick all the time we went thru databases. I’ve read up on most stuff, like connect to mysql, select DB and that. But something I can’t figure out is how to add data in the columns of a table.
I’ve tried what i could find online but I haven’t found anything useful really… So I was wondering if anyone here could be so kind to show me how write stuff to a table with these columns: http://imageshack.us/photo/my-images/851/sqla.png/
I don’t need help to select DB etc, just how to write those data into the db. Or a link to a guide for dummies like myself… I’ve tried a lot of different ways with
mysql_query(INSERT INTO *** VALUES ****)
But I cannot get it to work..
Any help would be really appreciated, feeling totally lost.
Thanks in advance!
My guess is that
song_idis related to some other table so you would need to have a validsong_idin your insert request, but something like this should work:Notice that the
song_idshould be replaced with a valid id if it’s related to another table:You should also try checking the mysql documentation for this kind of questions.