MyBB Community Forums
MySQL - testing - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: Community Archive (https://community.mybb.com/forum-106.html)
+--- Forum: Archived Forums (https://community.mybb.com/forum-143.html)
+---- Forum: Miscellaneous Archive (https://community.mybb.com/forum-140.html)
+----- Forum: Showcase (https://community.mybb.com/forum-17.html)
+----- Thread: MySQL - testing (/thread-6281.html)



MySQL - testing - Simulationcity - 2006-01-24

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:
.php   index.php (Size: 1.81 KB / Downloads: 218)

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.


RE: MySQL - testing - Michael S. - 2006-01-24

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.


RE: MySQL - testing - Simulationcity - 2006-01-24

Table column?


RE: MySQL - testing - Michael S. - 2006-01-25

Does your table in the database contain personal data? If not please post a dump.


RE: MySQL - testing - Simulationcity - 2006-01-25

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.