{"id":1195,"date":"2022-08-30T15:13:58","date_gmt":"2022-08-30T15:13:58","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2013\/11\/10\/facebook-connect-user-info-to-mysql-database-closed-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:13:58","modified_gmt":"2022-08-30T15:13:58","slug":"facebook-connect-user-info-to-mysql-database-closed-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/facebook-connect-user-info-to-mysql-database-closed-collection-of-common-programming-errors\/","title":{"rendered":"facebook connect user info to mysql database [closed]-Collection of common programming errors"},"content":{"rendered":"<p>It&#8217;s probably because you have some weird syntax (at least I have never seen it) in this line:<\/p>\n<pre><code>$result = mysql_query(\"INSERT INTO 'feelmyli_facebooktry'.'users' ('name', 'email', 'password', 'gender', 'dob', 'phone') VALUES ('$name', '$email', '$password', '$gender', '$dob', '$phone')\");\n<\/code><\/pre>\n<p>You have already selected the db in the previous line (<code>mysql_select_db<\/code>). So no need to repeat that in the query.<\/p>\n<p>Query should only mention the TABLE name. And the single quotes don&#8217;t belong around the tablename or the column names.<\/p>\n<p>Like this:<\/p>\n<pre><code>$result = mysql_query(\"INSERT INTO users (name, email, password, gender, dob, phone) VALUES ('$name', '$email', '$password', '$gender', '$dob', '$phone')\");\n<\/code><\/pre>\n<p>I should also note that <code>mysql_<\/code> functions are deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQL extension should be used. Check out this link to decide on which extension suits you best.<\/p>\n<p>Generally speaking you should also escape input, but since Facebook supplies this it could be considered reliable. Still would be better to escape it. Better safe than sorry.<\/p>\n<p id=\"rop\"><small>Originally posted 2013-11-10 00:08:36. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>It&#8217;s probably because you have some weird syntax (at least I have never seen it) in this line: $result = mysql_query(&#8220;INSERT INTO &#8216;feelmyli_facebooktry&#8217;.&#8217;users&#8217; (&#8216;name&#8217;, &#8217;email&#8217;, &#8216;password&#8217;, &#8216;gender&#8217;, &#8216;dob&#8217;, &#8216;phone&#8217;) VALUES (&#8216;$name&#8217;, &#8216;$email&#8217;, &#8216;$password&#8217;, &#8216;$gender&#8217;, &#8216;$dob&#8217;, &#8216;$phone&#8217;)&#8221;); You have already selected the db in the previous line (mysql_select_db). So no need to repeat that in the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1195","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/1195","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=1195"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/1195\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=1195"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=1195"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=1195"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}