Save image url to Mysql Database

后端 未结 2 871
执念已碎
执念已碎 2021-01-24 14:58

I have a database named \'mysqlproject\' that contains two tables. One of the tables that i am interesting in is named markers and declared in database like this :



        
2条回答
  •  故里飘歌
    2021-01-24 15:17

    If you want to do an INSERT, then your VALUES is misplaced.

    Do:

    $results = mysql_query("INSERT INTO markers (PhotosEvent) VALUES ('$dataURL')...
    

    Also make sure session_start(); is loaded, since you are using sessions.

    After seeing the comments in your question, then if

    UPDATE markers SET PhotosEvent = '$dataUrl' WHERE id = $_SESSION['id']
    

    or

    UPDATE markers SET PhotosEvent = '$dataUrl' WHERE id = '".$_SESSION['id']."'
    

    did not work, then that could be the reason.

    Add error reporting to the top of your file(s) which will help during production testing.

    error_reporting(E_ALL);
    ini_set('display_errors', 1);
    

    and mysql_error()

    Using those error reporting methods will help find errors found in your code.

提交回复
热议问题