#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2013
    Posts
    52
    Rep Power
    2

    New to php, problems moving my code to a new site as layout is different.


    hey guys,

    im new to php, i have a code in my old site that uses the mysql db on my server, but seeing as the new site is a different layout im flummuxed on how to change it.

    the code was written by a friend of mine and atm he is quite busy so no chance of getting hold of him.

    any help would be greatly appreciated
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Jul 2003
    Posts
    3,350
    Rep Power
    594
    Based on what you posted, what exactly are you expecting someone to tell you?
    There are 10 kinds of people in the world. Those that understand binary and those that don't.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2013
    Posts
    52
    Rep Power
    2
    i can post the current php code here, but what i was wanting was to post my website link here, so they could see what i was on about, but new people cant post links.

    i am a newbie at php so im kind of confused at what i need to do to get it working.
  6. #4
  7. Sarcky
    Devshed Supreme Being (6500+ posts)

    Join Date
    Oct 2006
    Location
    Pennsylvania, USA
    Posts
    10,846
    Rep Power
    6351
    What do you mean by "layout"? Why is the layout (traditionally referring to the CSS styling of the site) affecting your MySQL connection?

    What, exactly, is the problem? You're trying to move a whole set of code from one server to another? You're trying to make a second website using code from the first? You're trying to change the underlying database structure of a site?

    You can post URLs with (dot) and (slash) and we'll reassemble them if you really need to, but I'm not sure what a link is going to do for us since the question isn't really clear.
    HEY! YOU! Read the New User Guide and Forum Rules

    "They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin

    "The greatest tragedy of this changing society is that people who never knew what it was like before will simply assume that this is the way things are supposed to be." -2600 Magazine, Fall 2002

    Think we're being rude? Maybe you asked a bad question or you're a Help Vampire. Trying to argue intelligently? Please read this.
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Jul 2003
    Posts
    3,350
    Rep Power
    594
    Post your code here (that is what this forum is for). Be sure to use [ PHP ] tags (see the sticky at the top of this forum). After posting, explain what is going wrong and where, along with any errors you are getting (especially in the httpd log).

    P.S. You might run phpinfo on both servers and compare the result.
    There are 10 kinds of people in the world. Those that understand binary and those that don't.
  10. #6
  11. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2013
    Posts
    52
    Rep Power
    2
    <?php

    // You only need a single query to draw all the news section
    // Remember that Limit number -currently 2- is just the news items you want to show in the main index

    $data = mysql_query("SELECT id, day, month, year, headline, text, signature, img1, img2, img3 FROM news ORDER by ID DESC LIMIT 2", $CONNECT);
    while($row = mysql_fetch_row($data))
    {

    echo "
    <div class='article'>
    <h2>$row[4]...</h2>
    <p class='infopost'>Posted <span class='date'>on $row[1]/$row[2]/$row[3]</span> by <a href='#'>$row[6]</a> &nbsp;&nbsp;|&nbsp;&nbsp; &nbsp;&nbsp; </p>
    <div class='clr'></div>
    <div class='img'><img src='$row[7]' width='200' height='150' alt='' class='fl' /><Br /><BR /><BR />
    <img src='$row[8]' width='200' height='150' alt='' class='fl' /><Br /><BR /><BR />
    <img src='$row[9]' width='200' height='150' alt='' class='fl' /></div>
    <div class='post_content'>
    $row[5]

    <p>&nbsp;</p>
    <p>&nbsp;</p>

    </div>
    <div class='clr'></div>
    </div>";
    }

    ?>


    thats the php code im using at the moment...

    but i cannot get it changed to fit this page...
    www(dot)draigracing(dot)co.uk(slash)news(dot)html

    the layout of the page designs are completely different.
  12. #7
  13. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Jun 2009
    Posts
    676
    Rep Power
    7
    When you say to fit, what to you mean? Dimensions are probably in your css file within the .article or .infopost area.


    EDIT: Or even .post_content
  14. #8
  15. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2013
    Posts
    52
    Rep Power
    2
    ok let me try and clarify what i mean...

    that code is for this...

    www(dot)draigracing(dot)co(dot)uk

    and i want to change it to work on this page some how

    http://draigracing(dot)co(dot)uk(slash)Draigracingnewsite(slash)news(dot)html
  16. #9
  17. --
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Jul 2012
    Posts
    3,957
    Rep Power
    1046
    Is this your problem? Do you see an error message on your screen?

    That would explain why your "layout" is somehow messed up ...
    The 6 worst sins of security ē How to (properly) access a MySQL database with PHP

    Why canít I use certain words like "drop" as part of my Security Question answers?
    There are certain words used by hackers to try to gain access to systems and manipulate data; therefore, the following words are restricted: "select," "delete," "update," "insert," "drop" and "null".
  18. #10
  19. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2013
    Posts
    52
    Rep Power
    2
    Originally Posted by Jacques1
    Is this your problem? Do you see an error message on your screen?

    That would explain why your "layout" is somehow messed up ...
    that was my error i thought it was a mysql error as it said couldnt get it, but sorted that out it was a comma that needed to be deleted

IMN logo majestic logo threadwatch logo seochat tools logo