{"id":7248,"date":"2014-06-03T22:50:23","date_gmt":"2014-06-03T22:50:23","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/06\/03\/syntax-error-unexpected-mysql_connect-t_string-closed-collection-of-common-programming-errors\/"},"modified":"2014-06-03T22:50:23","modified_gmt":"2014-06-03T22:50:23","slug":"syntax-error-unexpected-mysql_connect-t_string-closed-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/06\/03\/syntax-error-unexpected-mysql_connect-t_string-closed-collection-of-common-programming-errors\/","title":{"rendered":"syntax error, unexpected &#39;mysql_connect&#39; (T_STRING) [closed]-Collection of common programming errors"},"content":{"rendered":"<pre><code>$mysql_db = 'socialnetwork'\nmysql_connect($mysql_host, $mysql_user, $mysql_pass or die(\"Couldn't Connect\") ;\necho 'Connected!'\n<\/code><\/pre>\n<p>should be<\/p>\n<pre><code>$mysql_db = 'socialnetwork';\n                           ^\nmysql_connect($mysql_host, $mysql_user, $mysql_pass) or die(\"Couldn't Connect\") ;\n                                                   ^\necho 'Connected!';\n                 ^\n<\/code><\/pre>\n<p>FYI, you shouldn&#8217;t use <code>mysql_*<\/code> functions in new code. They are no longer maintained and are officially deprecated. See the red box? Learn about <em>prepared statements<\/em> instead, and use PDO or MySQLi &#8211; this article will help you decide which. If you choose PDO, here is a good tutorial.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>$mysql_db = &#8216;socialnetwork&#8217; mysql_connect($mysql_host, $mysql_user, $mysql_pass or die(&#8220;Couldn&#8217;t Connect&#8221;) ; echo &#8216;Connected!&#8217; should be $mysql_db = &#8216;socialnetwork&#8217;; ^ mysql_connect($mysql_host, $mysql_user, $mysql_pass) or die(&#8220;Couldn&#8217;t Connect&#8221;) ; ^ echo &#8216;Connected!&#8217;; ^ FYI, you shouldn&#8217;t use mysql_* functions in new code. They are no longer maintained and are officially deprecated. See the red box? Learn about prepared statements [&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-7248","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/7248","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=7248"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/7248\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=7248"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=7248"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=7248"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}