Can't upload my database to for my site

  • (2 Pages)
  • +
  • 1
  • 2

18 Replies - 841 Views - Last Post: 27 November 2011 - 05:25 AM Rate Topic: -----

#1 headboy337  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 18
  • Joined: 23-September 09

Can't upload my database to for my site

Posted 26 November 2011 - 04:55 AM

I have my site uploaded and connected. It won't show because of this script

<?
$linkID = mysql_connect("localhost","fmsdesig_Twisted", "97026574")
        or exit("Could not connect");
    
mysql_select_db ("fmsdesig_demo");

?>



Is there something wrong with this script? It was in my dbase.php and I sought help Could someone help me?

I changed everything in blue, Is there something wrong with the black?

Is This A Good Question/Topic? 0
  • +

Replies To: Can't upload my database to for my site

#2 huzi8t9  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 23
  • View blog
  • Posts: 326
  • Joined: 11-July 07

Re: Can't upload my database to for my site

Posted 26 November 2011 - 05:16 AM

EDIT

Quote

If you're using short open tags, ensure they're enabled in your php.ini, or use <?php instead of <? just to be sure.


It all looks correct, by syntax. Although I'd verify the login information; I know you changed it to seek help and didn't give away any valuables, but still check 'em. Also, is the page dying when you try to connect, or are you just unable to make any queries?

It's good practise to also verify that your table is being selected.

<?php
$link = mysql_connect("HOST", "USERNAME", "PASSWORD") or die("Unable to connect. MySQL said: <b>". mysql_error() ."</b>");
$select = mysql_select_db("DATABASE") or die("Unable to select database. MySQL said: <b>". mysql_error() ."</b>");
?>



Hope this helps

~huzi

This post has been edited by huzi8t9: 26 November 2011 - 05:17 AM

Was This Post Helpful? 0
  • +
  • -

#3 headboy337  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 18
  • Joined: 23-September 09

Re: Can't upload my database to for my site

Posted 26 November 2011 - 05:20 AM

The page is dying, and when I put in that code you gave me, it went to my domain went to the serverhost page. www.xrayplay.com
Was This Post Helpful? 0
  • +
  • -

#4 huzi8t9  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 23
  • View blog
  • Posts: 326
  • Joined: 11-July 07

Re: Can't upload my database to for my site

Posted 26 November 2011 - 05:23 AM

View Postheadboy337, on 26 November 2011 - 12:20 PM, said:

The page is dying, and when I put in that code you gave me, it went to my domain went to the serverhost page. www.xrayplay.com


Sorry, could you try and word that differently please. I don't understand.

I get that the page is dying. However, I don't get the rest. Is it that your domain is redirecting you to your homepage/index page?

~huzi
Was This Post Helpful? 0
  • +
  • -

#5 headboy337  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 18
  • Joined: 23-September 09

Re: Can't upload my database to for my site

Posted 26 November 2011 - 05:25 AM

no, the page looks right, but in the address bar, my address shows correctly

THe page looks blank, but the address bar shows correctly

(disregard the last post)
Was This Post Helpful? 0
  • +
  • -

#6 huzi8t9  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 23
  • View blog
  • Posts: 326
  • Joined: 11-July 07

Re: Can't upload my database to for my site

Posted 26 November 2011 - 05:27 AM

View Postheadboy337, on 26 November 2011 - 12:25 PM, said:

no, the page looks right, but in the address bar, my address shows correctly

THe page looks blank, but the address bar shows correctly

(disregard the last post)


It'd appear that your code is being killed before the query then. Is this MySQL connection being queried at the the very top of the page, or..?

~huzi
Was This Post Helpful? 0
  • +
  • -

#7 headboy337  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 18
  • Joined: 23-September 09

Re: Can't upload my database to for my site

Posted 26 November 2011 - 05:29 AM

for the host section of that script should I put "localhost"

no its is not

I upload my sql file correctly with everything in place, but that piece of script that I posted is incorrect. I even had techs from the server company help me with my db name and password placements. They told me to put local host for the server name
Was This Post Helpful? 0
  • +
  • -

#8 huzi8t9  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 23
  • View blog
  • Posts: 326
  • Joined: 11-July 07

Re: Can't upload my database to for my site

Posted 26 November 2011 - 05:30 AM

View Postheadboy337, on 26 November 2011 - 12:27 PM, said:

for the host section of that script should I put "localhost"


That's commonly used, but I'd verify that just to be sure. Login to your cPanel, and navigate to phpMyAdmin. There you should see your connection details. If not, navigate to something along the lines of "phpMyAdmin Users"

~huzi
Was This Post Helpful? 0
  • +
  • -

#9 headboy337  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 18
  • Joined: 23-September 09

Re: Can't upload my database to for my site

Posted 26 November 2011 - 05:33 AM

Server: Localhost via UNIX socket
Server version: 5.0.77
Protocol version: 10
User: xrayp_play@localhost
MySQL charset: UTF-8 Unicode
Was This Post Helpful? 0
  • +
  • -

#10 huzi8t9  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 23
  • View blog
  • Posts: 326
  • Joined: 11-July 07

Re: Can't upload my database to for my site

Posted 26 November 2011 - 05:41 AM

View Postheadboy337, on 26 November 2011 - 12:33 PM, said:

Server: Localhost via UNIX socket
Server version: 5.0.77
Protocol version: 10
User: xrayp_play@localhost
MySQL charset: UTF-8 Unicode


then I should assume your connection string would be
<?php
$link = @mysql_connect("localhost", "xrayp_play", "PASSWORD");
$select = @mysql_select_db("DATABASE");
if ( !$link )
{
     die("An error occured.<br />\nMySQL said [". mysql_errno() ."] ". mysql_error();
}
else
{
     if ( !$select )
     {
          die("An error occured.<br />\nMySQL said [". mysql_errno() ."] ". mysql_error();
     }
     else
     {
          die("MySQL connected and database selected. Good work ;)/>");
     }
}
?>



Give that a try. It should die either way, but at least you'll get a success of failure message.

~huzi
Was This Post Helpful? 0
  • +
  • -

#11 headboy337  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 18
  • Joined: 23-September 09

Re: Can't upload my database to for my site

Posted 26 November 2011 - 05:48 AM

I didn't, maybe it's a problem somewhere else in the script?
Was This Post Helpful? 0
  • +
  • -

#12 huzi8t9  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 23
  • View blog
  • Posts: 326
  • Joined: 11-July 07

Re: Can't upload my database to for my site

Posted 26 November 2011 - 06:02 AM

View Postheadboy337, on 26 November 2011 - 12:48 PM, said:

I didn't, maybe it's a problem somewhere else in the script?


That's all I can assume Personally, I keep my functions and headers at the top of the page, then if anything goes wrong, I'll always know. Of course, headers must be outputted before any HTML, else you'll receive an error, which I assume you're already aware of :)

~huzi
Was This Post Helpful? 0
  • +
  • -

#13 headboy337  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 18
  • Joined: 23-September 09

Re: Can't upload my database to for my site

Posted 26 November 2011 - 06:07 AM

It brought my page up, but the page looked funny. www.xrayplay.com

THe PHP coding is on the page. So, I know the source to my problem is these couple of lines of code, am I correct?
Was This Post Helpful? 0
  • +
  • -

#14 huzi8t9  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 23
  • View blog
  • Posts: 326
  • Joined: 11-July 07

Re: Can't upload my database to for my site

Posted 26 November 2011 - 06:08 AM

View Postheadboy337, on 26 November 2011 - 01:05 PM, said:

It brought my page up, but the page looked funny. www.xrayplay.com


I got redirected to "index_ie.php" (using Google Chrome) with an error.

Quote

The website encountered an error while retrieving http://xrayplay.com/index_ie.php. It may be down for maintenance or configured incorrectly.


This looks like it could possibly be a HTACCESS error.

~huzi
Was This Post Helpful? 0
  • +
  • -

#15 headboy337  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 18
  • Joined: 23-September 09

Re: Can't upload my database to for my site

Posted 26 November 2011 - 06:14 AM

htcaccess error?
Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2