Hello! Just made an script and its giving me a error! Parse error: syntax error, unexpected T_VARIABLE in /home/clanessc/public_html/highranks/index.php on line 18 Code (markup): Ok, Heres my full script <HTML> <BODY> <!--set up the table --> <TABLE BORDER="1" CELLPADDING="5"> <TR> <TH>Report ID:</TH> <TH>Highrank Username:</TH> <TH>Username Demoted:</TH> <TH>Rank Before Demotion:</TH> <TH>Rank After Demotion:</TH> <TH>Date:</TH> <TH>Time:</TH> <TH>Reason:</TH> </TR> <? include 'includes/config.php' // This builds and executes the insert query $select = "SELECT ID, hr, ud, rb, ra, dat, time, reason FROM tbl_demologs"; $result = mysqli_query($link, $select); // This loops through results and fills table! while ($row = mysqli_fetch_array($result)) { // Get element and put into an varible $ID = $row['ID'] $hr = $row['hr'] $ud = $row['ud'] $rb = $row['rb'] $ra = $row['ra'] $dat = $row['dat'] $time = $row['time'] $reason = $row['reason'] // This prints out our little code for each row! echo <<<END <TR> <TD>$ID</TD> <TD>$hr</TD> <TD>$ud</TD> <TD>$rb</TD> <TD>$ra</TD> <TD>$dat</TD> <TD>$time</TD> <TD>$reason</TD> </TR> END; } ?> <!-- Close table --> </TABLE> </BODY> </HTML> Code (markup): And my config.php here <? $link = mysqli_connect('clan-ess.co.uk','clanessc_high','Root','PassRemovedSecurityReasons'); ?> Code (markup): Can anybody please help me fix this error =D? Thanks, James
change: include 'includes/config.php' Code (markup): to include 'includes/config.php'; Code (markup):
One more error... Parse error: syntax error, unexpected T_VARIABLE in /home/clanessc/public_html/highranks/index.php on line 26
You should use " ; " in the end of each command. Change these lines : $ID = $row['ID']; $hr = $row['hr']; $ud = $row['ud']; $rb = $row['rb']; $ra = $row['ra']; $dat = $row['dat']; $time = $row['time']; $reason = $row['reason']; PHP:
Another one :S I checked the script but i dont get whats wrong !? Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in /home/clanessc/public_html/highranks/index.php on line 23 and thanks mpa
Database is empty, SQL is wrong or database connection problem add this code : echo 'Error : ' . mysql_error($link); PHP: After this : $result = mysqli_query($link, $select); PHP: And look what says
Error : Table 'clanessc_hsystem.tbl_demologs' doesn't exist clanessc_hsystem and tbl_demologs DO exist :S
syntactically it should be : mysqli_connect('localhost', 'my_user', 'my_password', 'my_db'); PHP: as per http://www.php.net/manual/en/mysqli.connect.php So in your case : mysqli_connect('clan-ess.co.uk','clanessc_high','Root','PassRemovedSecurityReasons'); PHP: (u have changed the order before posting?) you are selecting db name as "clanessc_high" and your error shows "clanessc_hsystem" sorry if m incorrect but i got a bit confused! :?
try this query instead : $select = "SELECT ID, hr, ud, rb, ra, dat, time, reason FROM clanessc_hsystem.tbl_demologs"; PHP: and see if it helps
Still getting error Error : Table 'clanessc_hsystem.tbl_demologs' doesn't exist Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in /home/clanessc/public_html/highranks/index.php on line 24