Jump to content

Mysql/php/web


Spitsbe
 Share

Recommended Posts

I too am having problems getting my data bases on my web.

I fear that it is something simple like a file in the wrong place or something. I have made a php file, "30.php" and used the file download link (via cute) to link it to my Site.

 

I also am not connecting to the db.

 

Here is the code that I am attempting to use. If any one once to take a stab at it. I sure could use some help. I been at this for a couple of days.

 

<html>

<head>

<title>Over 30 league</title>

</head>

<body>

<?php

 

$dbcnx = @mysql_connect('localhost', 'public_html', 'passswd');

if (!$dbcnx) {

die( '<p>Unable to connect to the '.

'database at this time.</p>' );

}

 

 

if (! @mysql_select_db('spitsyc_Over') ) {

die( '<p>Unable to locate the data tb.</p>' );

}

 

?>

<p> teams: </p>

<blockquote>

<?php

 

 

$result = @mysql_query('SELECT TeamText FROM Over 30 teams');

if (!$result) {

die('</p> Error performin query: ' . mysql_error() .

'</p>');

}

 

//While ( $row = mysql_fetch_array($result) ) {

// echo('<p>' . $row['TeamText'] . '</p>;

 

?>

 

 

I took out the last part to try and simplify.

 

Thanks in advance, Spitsbe

Link to comment
Share on other sites

Well, I think I got it talking to the DB now. I am pretty sure that it sees my sql too. Now I just need to get it to display it on my Web page.

 

I took out the @ error suppresion operators so I could see the errors that were coming up. Thus, I have cleared the errors.

 

Now I am getting a

 

Parse error: parse error, unexpected $ in /home/spitsyc/public_html/HTMLobj-232/30.php on line 37

 

Step by step. it wont be long now.

 

Spitsbe

Link to comment
Share on other sites

This is where I am now. I found the line 37 error. I working on the line 32 error now. lol

 

Parse error: parse error, unexpected ';' in /home/spitsyc/public_html/HTMLobj-240/30.php on line 32

 

<html>

<head>

<title>Over 30 league</title>

</head>

<body>

<?php

 

$dbcnx = mysql_connect('localhost', 'spitsyc', 'passwrd');

if (!$dbcnx) {

die( '<p>Unable to connect to the '.

'database at this time.</p>' );

}

 

 

if (! @mysql_select_db('spitsyc_Over') ) {

die( '<p>Unable to locate the data tb.</p>' );

}

 

?>

<p> teams: </p>

<blockquote>

<?php

 

 

$result = mysql_query('SELECT * FROM `Teams` WHERE 1');

if (!$result) {

die('<p>Error performing query: ' . mysql_error() .

'</p>');

}

 

While ( $row = mysql_fetch_array($result) ) {

echo('<p>' . $row['Teamsx'] . '</p>'; <---line 32

 

?>

</blockquote>

</body>

</html>

 

 

Thanks for jumping in. I can taste victory on this.

Link to comment
Share on other sites

Amazing, I got it to work.

The biggest help was taking the error supression off.

In addition I found a couple of typos. And the what do you know.

 

Thanks for your help.

Now it's on to other battles.

 

I hope I didn't waste too much of anyones time. I can't believe I have been messing with this for 2 days. lol

 

Spitsbe

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...