Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
MySQL - testing
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: 225)

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.
[Image: bannersimcity4bn.jpg]
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.
[Image: donation_drive_sig.png]
Table column?
[Image: bannersimcity4bn.jpg]
Does your table in the database contain personal data? If not please post a dump.
[Image: donation_drive_sig.png]
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.
[Image: bannersimcity4bn.jpg]

Forum Jump:

Users browsing this thread: 1 Guest(s)