MyBB Community Forums

Full Version: MySQL - testing
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I made a test MySQL test page and when I run it I get the message:

Parse error: syntax error, unexpected T_STRING in C:\Program Files\xampp\htdocs\mysqltest\index.php on line 15

Here's the file that I made: [attachment=2142]

A little clip from the MySQL select:

mysql_query (SELECT page01 FROM content WHERE (website);

page01 is the row, content is the table, and website is the database.
Website is the name of the database? I think that won't work...

Try this:
$db = mysql_connect ('localhost', '$user', '$password');
mysql_select_db('website', $db);
$data = mysql_query (SELECT * FROM content WHERE x = 'page01');
mysql_close ($db);
Replace x with the name of the table column.
Table column?
Does your table in the database contain personal data? If not please post a dump.
Topic name: RE: MySQL - testing

I wouldn't post personal data in a test database. And what's a dump other than a garbage dump?

I finnally got it to stop showing errors but no data from the database shows up.

mysql_connect ('localhost', 'm57690j', 'guy4598');
$row = mysql_query ('SELECT row1 FROM page01 WHERE (website)');
print $row;
mysql_error ();
mysql_close ();

database name: website
table: page01
row: row1

I'm keeping it simple for my first try.