I am trying to use mysql xampp php myAdmin.
User Here is my code: You are not using a password and error means that User has no access to root or has no access because it requires a password. Route is by default in mysql DB.
& lt; Html & gt; & Lt; Body & gt; & Lt ;? Php $ dbCon = @ mysql_connect ("localhost", "root", ''); If (! $ DbCon) {echo ('& lt; p & gt;' .mysql_error (). '& Lt; / p & gt;'); Go out(); } And {if (@@mysql_select_db ("crs", $ dbCon)) {dar ("& lt; p>". Mysql_error (). "& Lt; / p & gt;"); }} $ Qry = "Create a table course (ccode varChar (5) tap primary key, cTitle VarChar (50) faucet, CH INT)"; If (@ msql_query ($ curie)) {echo ('& lt; p & gt; course table has been created & lt; / p & gt;'); } Else {echo ('& lt; p & gt; Course Table' can not be made due to .mysql_error (). '& Lt; / p & gt;'); } $ Qry = "Insert" in the course courses ('C001', 'Introduction to Computing', 4); if (@msql_query ($ curie)) {echo ('& lt; p & gt; c101 inserted Has been & lt; / p & gt; ');} Else {echo (' & lt; p & gt; Course table 'can not be created due to' Mysql_error (.). '& Lt; / p & gt; ;);} $ Qry = "INTO course values ('C002', 'Programming Fundamentals', 4), ('C003', 'Object Oriented Programming', 4), ('C004', 'Operating System' 4) Insert 'C 005', 'data structures and so on ('& Lt; p & gt; 4 rows have been entered & lt; / p & gt;');} Else echo ('& algorithm', 4) "; (@ MSQL_query ($ curie) Lt; p & gt; Multiple Lines'. Mysql_error (). '& Lt; / p & gt;')? & Gt; & lt; / body & gt; & lt; / html & Gt;
No comments:
Post a Comment