Skip navigation
Currently Being Moderated

Issue with folder in remote view

Apr 12, 2013 5:27 AM

Ive just created a new web page which needs the use of a database so i saved my website under a separate name and tested it on MAMP first to make sure it all works. I then wanted to upload this to my live site, i did this by copying the new folder (admin)  and pasted it into my live site. I then uploaded them and tried opening the page from the live site but it wont open. (Please see image below.) The other thing i noticed is when i look at my files panel in 'local view' everything looks fine but when i look at it in 'remote view' the admin folder (which holds all the new files) doesnt look right, the folder appears as one file and is blank?

 

 

 

screenshot.jpg```

 
Replies
  • Currently Being Moderated
    Apr 12, 2013 6:04 AM   in reply to Ness_quick

    Firstly what in the donations_2.php on line 394  on your remote server which is in the 'blog' folder.

     

    Secondly why are you trying to open a folder with TextEdit?

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 12, 2013 7:54 AM   in reply to Ness_quick

    Try using the below connection instead of <?php require_once('../Connections/milesdata.php'); ?> and see what happens:

     

     

    $con=mysqli_connect("123-reg","users","users","milesdata");

    // Check connection

    if (mysqli_connect_errno())

       {

       echo "Failed to connect to MySQL: " . mysqli_connect_error();

       }

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 12, 2013 8:35 AM   in reply to Ness_quick

    You may have to contact 123 and ask what the connections to the database should be. It may be something to do with the way its hosted and where the database is stored for each domain on the package.

     

    Normally you would just echo the same set up as localhost BUT in your case you have more than one domain hosted on the package, I don't know how that works and if it affects the database connection requirements

     

    I dont quite know what the set up is - milesdata.php seems to be in a 'blog' folder and if you have it in the 'admin;' folder as well it might be a case of you need to include and extra ../ before the Connection link:

     

    <?php require_once('../../Connections/milesdata.php'); ?>

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 12, 2013 9:15 AM   in reply to Ness_quick

    So are you saying if you remove the code below from the page all works according to how it should?

     

    <?php

    $con=mysqli_connect("cust-mysql-123-12","milesdata","username","passwo rd");

    // Check connection

    if (mysqli_connect_errno())

       {

       echo "Failed to connect to MySQL: " . mysqli_connect_error();

       }

    mysqli_query($con,"DELETE FROM donation WHERE dateCreated < DATE_SUB(NOW(), INTERVAL 1 DAY");

    mysqli_close($con);

    ?>

     

     

    Try replacing it with:

     

    <?php

    $deleteSQL = sprintf("DELETE FROM donation WHERE dayCreated < DATE_SUB(NOW(), INTERVAL 1 DAY)",

    mysql_select_db($database_milesdata, $milesdata);

    $Result1 = mysql_query($deleteSQL, $milesdata) or die(mysql_error());

    ?>

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 12, 2013 9:32 AM   in reply to Ness_quick

    Ness_quick wrote:

     

    Do you think this could be because i have the same database on both MAMP and my host?

    No, nothing to do with that. The remote site and the local site are seperate. IF your local site is working and the remote is not it is the way the remote server is set up.

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 12, 2013 9:35 AM   in reply to Ness_quick

    Ness_quick wrote:

     

    Well i deleted that bit of code and straight away the page loaded, i put mt details in, then it came up with no database selected, so i then checked my database connection on that page but there are no tables for 'milesdata' and when i try to test or select a database all that happens is this message alert "Unidentified erroe has occured". Do you think this could be because i have the same database on both MAMP and my host? Should i delete the MAMP database and tables?

     

    I take it you have migrated your local database .sql file over to the remote server by importing it via phpMyAdmin?

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 12, 2013 1:35 PM   in reply to Ness_quick

    Ness_quick wrote:

     

    Er no! How do i do that?? I just recreated the same dadtabase in phpmyadim, so that everything is the same as it was in MAMP. I just read your other post, shall i delete what i created and import that file as you suggested?

    What you should have done is open up your local copy of phpMyAdmin select the database 'milesdata'. Along the top of the screen you will see an 'Export' tab. Click that and scroll to the bottom of the screen and choose the checkbox 'Save as file', in the bottom left corner. Click 'GO' in the bottom right of screen and save the file to your computer. It should save as milesdata.sql

     

    Open up the remote version of phpMyAdmin and along the top of the screen choose the 'Import' tab. Browse to the 'milesdata.sql' file on your computer and choose it. That migrates the database to the remote site.

     

    Dont forget to get rid of the current remote 'milesdata' database by choosing it and selecting 'Drop' from the menu along the top of the screen before you import the replacement.

     

    Please make sure you try and back everything up. I always have at least 3 back-ups somewhere, either on disk or external, stick etc when I get into a position where everything is working.

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 13, 2013 11:35 AM   in reply to Ness_quick

    You're confusing me now. I don't know if we are talking about issues with the remote site or the local site. I thought the local site was working?

     

    So now what you are saying is the local site no longer works?

     

    I don't know why all of a sudden you have no tables in your database when they were there.

     

    You may well have to retrace your steps by creating a fresh connection using the same recordset names and see if the tables come back. I take it the tables are showing in phpMyAdmin?

     

    Like I said always keep 2 or 3 back-up copies once you get so far with a project.

     

    At this stage I'm fresh out of ideas. I would open a clean Dreamwevaer page in your site folder, create a new recordset and see if the record set shows the donations table and filtering information.

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 14, 2013 10:57 AM   in reply to Ness_quick

    Ness_quick wrote:

     

    The local site works fine, i used MAMP to test everything first before moving it to my live site.

    OK so that's good news.

     

     

    Ness_quick wrote:

    So its the remote site i am having problems with. I changed the settings on the relevant pages from local host to my server host, uploaded everything but when i try to do a search on the website (www.milesfunerals.com/donations_2.php) it goes to a page which tells me, "no database selected" I dont know where i have gone wrong or why it cant find the database?

     

     

    If you are getting a message saying: 'no database selected', then that most probably means that the database connection details to your remote database is incorrect.

     

    What is the name of your remote database and what is the name you have given it in the remote 'connections file' folder? That file will be in your Connections folder in your site folder

     

    I always have two connection files in the Connections folder, one for localhost connection and one for remote host connection. I duplicate the localhost connection file and replace the details in it for the remote connection details then upload that to the remote server in the Connections folder.

     

    At this stage we can forget looking in the Dreamweaver panels for databases and tables as we have established the local site is working. This is a remote connection issue.

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 14, 2013 12:41 PM   in reply to Ness_quick

    Ness_quick wrote:

     

    The name of my remote database is the same as it was on my local site which is milesdata. Within the 'connections folder' i have two files one called 'connections' and another file called 'milesdata.php' Shall i post the contents of these files?

     

    You have a file in your Connections folder called 'connections' whats that?

     

    As far as I know Dreamweaver only creates one file - the .php file where the database connections details are stored.

     

    Have you contacted your host about this as I'm sure its a connection issue. If you don't get the connection information correct about where your remote database is stored it won't connect.

     

    I'd send an email to them or call them with your remote connection details and ask if its correct.

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 14, 2013 11:36 PM   in reply to Ness_quick

    Ness_quick wrote:

     

    Do you think i should i delete that 'connections' file so i only have that one milesdata.php file in my 'connections' folder?

     

    We'll I don't think it's doing any harm so don't delete it but why it's there I don't know unless newer versions of Dreamweaver automatcally create it for some purpose.

     

    Normally a remote 'hostname' connection name would typically be your 'domain name' or just simply 'localhost'

     

    $hostname_conWhatEver = "yourDomainName.co.uk";

    $database_conWhatEver = "databaseName";

    $username_conWhatEver= "remoteDatabaseUsername";

    $password_conWhatEver = "remoteDatabasePassword";

     

    I seem to recall you have something like '1-2-3-reg' for the hostname (that may well be correct BUT I have no idea. Each host is slighlty different and its a matter of finding out what the connection to the remote database information is.

     

    Example: I have hosting with 'ABC.co.uk' and my domain name is 'something.co.uk'.

     

    My 'ABC.co.uk' hostname connection for the database on 'something.co.uk' which is hosted on 'ABC.co.uk' is:

     

    $hostname_conWhatEver = "something.co.uk";

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 15, 2013 3:28 AM   in reply to Ness_quick

    Ok delete that block of php that is causing the trouble, delete the tags as well <?php ?>

     

    Insert the below in its place right after -  <?php require_once('../Connections/milesdata.php'); ?>

     

    <?php

    $deleteSQL = sprintf("DELETE FROM donation WHERE dayCreated < DATE_SUB(NOW(), INTERVAL 1 DAY)",

    mysql_select_db($database_conmilesdata, $conmilesdata);

    $Result1 = mysql_query($deleteSQL, $conmilesdata) or die(mysql_error());

     

     

    (I'm working from memory BUT I think your connection name is 'conmilesdata' ? Check by looking at another mysql query and ensure the details on line 2/3 above are correct)

     

     

    Ok I found  a reference to your connection so use the below NOT teh above:

     

    <?php

    $deleteSQL = sprintf("DELETE FROM donation WHERE dayCreated < DATE_SUB(NOW(), INTERVAL 1 DAY)",

    mysql_select_db($database_milesdata, $milesdata);

      $Result1 = mysql_query($insertSQL, $milesdata) or die(mysql_error());

    ?>

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 15, 2013 3:59 AM   in reply to Ness_quick

    Can you post the pages code here. Im not sure why it doesn't like that.

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 15, 2013 5:31 AM   in reply to Ness_quick

    Copy the block of code below and insert it directly before the <!DOCTYPE> tag as shown below AND DELETE the other php block that was throwing an error.

     

     

    <?php

     

    $deleteSQL = sprintf("DELETE FROM donation WHERE dayCreated < DATE_SUB(NOW(), INTERVAL 1 DAY)",

    GetSQLValueString($_POST['id'], "int"));

    mysql_select_db($database_milesdata, $milesdata);

    $Result1 = mysql_query($deleteSQL, $milesdata) or die(mysql_error());

     

    ?>

     

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points