i am getting parse error from this code can anyone see a prob with it. the code is meant to return the number of rows then i can loop down and get all data.
Parse error: parse error, unexpected T_VARIABLE in C:\Program Files\Apache Group\Apache2\Personal\datastu.php on line 26.
this is datastu.php which is include() from another page
i have put code on here because it is a parse error hope that correct.
the user name & password are correct.
thx
To err is human, to completely mess up takes a computer.![[morning] [morning] [morning]](/data/assets/smilies/morning.gif)
Parse error: parse error, unexpected T_VARIABLE in C:\Program Files\Apache Group\Apache2\Personal\datastu.php on line 26.
this is datastu.php which is include() from another page
Code:
<?php
session_start();
/********datastu.php*****/
/***Connect to database*/
/**By asmtony***********/
/***********************/
/*this file contains the*
**database conection for*
**********SES***********/
//database specific
DEFINE (DB_HOST, "JSTTECH");
DEFINE (DB_NAME, "students");
//get session vars
$DB_USER = $_SESSION['user'];
$DB_PASSWORD = $_SESSION[password];
//connect to MySQL
$dbcon = mysql_connect(DB_HOST, $DB_USER, $DB_PASSWORD);
//select the database
mysql_select_db(DB_NAME,$dbcon);
Print"Connected to Student Database ";
//create the sql statement
$sql = "SELECT * FROM studentdetails";
print "$sql"
//execute the sql
$result = mysql_query($sql, $dbcon);
//get the number of rows in the result
$numrows = mysql_numrows($result);
echo"<br>The number of records in the database is $numrows<br>\n";
mysql_close();
?>
i have put code on here because it is a parse error hope that correct.
the user name & password are correct.
thx
To err is human, to completely mess up takes a computer.
![[morning] [morning] [morning]](/data/assets/smilies/morning.gif)