Page 1 of 3 123 LastLast
Results 1 to 10 of 24
  1. #1
    Join Date
    Feb 2008
    Location
    Plymouth
    Posts
    346
    Tokens
    0

    Default mySQL help please?

    Hey I need this file for one of my index pages to run but when I enter my database info it doesn't work :S

    PHP Code:
    if ($sql_mode==2) {
    $crishn pg_connect("$localhost","5432","$sql_data");
    } else if (
    $sql_mode==3) {
    $crishn mssql_connect($host$sql_user$changeme);
    $crashn mssql_select_db($sql_data);
    } else if (
    $sql_mode==4) {
    $crishn odbc_connect($sql_data$host$changeme);
    } else {
    $crishn mysql_connect($localhost$host$changeme);
    $crashn mysql_select_db($host);

    I've put the database user and password as host and changeme due to me not wanting the database info being leaked And yes when I put in the correct database info it is the correct info.

    +REP to whoever helps
    I am Bojangles =]




  2. #2
    Join Date
    Oct 2006
    Location
    Peterborough, UK
    Posts
    3,855
    Tokens
    216

    Latest Awards:

    Default

    Quote Originally Posted by rawritsluke View Post
    Hey I need this file for one of my index pages to run but when I enter my database info it doesn't work :S

    PHP Code:
    if ($sql_mode==2) {
    $crishn pg_connect("$localhost","5432","$sql_data");
    } else if (
    $sql_mode==3) {
    $crishn mssql_connect($host$sql_user$changeme);
    $crashn mssql_select_db($sql_data);
    } else if (
    $sql_mode==4) {
    $crishn odbc_connect($sql_data$host$changeme);
    } else {
    $crishn mysql_connect($localhost$host$changeme);
    $crashn mysql_select_db($host);

    I've put the database user and password as host and changeme due to me not wanting the database info being leaked And yes when I put in the correct database info it is the correct info.

    +REP to whoever helps
    can you post the full script (obviously take out the details)


    visit my internet web site on the internet
    http://dong.engineer/
    it is just videos by bill wurtz videos you have been warned

  3. #3
    Join Date
    Feb 2008
    Location
    Plymouth
    Posts
    346
    Tokens
    0

    Default

    Hey, that is the full script, what it does is enable users to register and submit content, I forgot the includes tho

    PHP Code:
    <?php


    require "mysqlinfo.php";
    require 
    "actions.php";


    if (
    $sql_mode==2) {
    $crishn pg_connect("$localhost","5432","$sql_data");
    } else if (
    $sql_mode==3) {
    $crishn mssql_connect($sql_host$sql_user$sql_pass);
    $crashn mssql_select_db($sql_data);
    } else if (
    $sql_mode==4) {
    $crishn odbc_connect($sql_data$sql_user$sql_pass);
    } else {
    $crishn mysql_connect($db_host$db_user$db_pass);
    $crashn mysql_select_db($db_name);
    }

    ?>
    I then include this code in the other pages example:
    require "varfunctions.php";
    Last edited by rawritsluke; 23-03-2008 at 06:26 PM.
    I am Bojangles =]




  4. #4
    Join Date
    Sep 2006
    Location
    Evanston, Illinois.
    Posts
    2,361
    Tokens
    0

    Latest Awards:

    Default

    I don't understand what you're trying to do ;S It looks pointless..
    How could this hapen to meeeeeeeeeeeeeee?lol.

  5. #5
    Join Date
    Feb 2008
    Location
    Plymouth
    Posts
    346
    Tokens
    0

    Default

    Okay that script is for an install file. So when users download the cms they can install it. But I'm trying to get it to work. For them to install they need to input their database info but I've tried and it doesn't work.

    The includes are for submitting content etc.

    I am Bojangles =]




  6. #6
    Join Date
    Sep 2006
    Location
    Evanston, Illinois.
    Posts
    2,361
    Tokens
    0

    Latest Awards:

    Default

    LOL! I'm doing the EXACT thing now, and having troubles, I have so far:

    PHP Code:
    //blablabla
    elseif($_GET['step'] == "2") {  
    $sitename = $_POST['sitename'];
    if(isset($_POST['submit'])) {
    $host = $_POST['host'];
    $username = $_POST['username'];
    $password = $_POST['password'];
    $database = $_POST['database'];
    $contest = mysql_connect($host,$username,$password);
    $dbtest = mysql_select_db($database);
    $test = 0;
    if(!$contest) {
    $test = 0;

    if(!$dbtest) {
    $test = 0;
    } else {
    $test = 1;
    }
    if($test == "1") {
    echo "Success! Click <a href=\"step=3\">here</a>";
    } else {
    echo "Some of your information is incorrect, please try again.";

    ?>
    <form name="step1" method="post" action="?step=2">
    <input type="hidden" name="sitename" value="<?php echo $sitename?>" />
    <fieldset><legend>Host (Usually 'localhost')</legend>
    <input type="text" maxlength="100" name="dbhost" id="dbhost" value="localhost" />
    </fieldset>
    <fieldset><legend>Username</legend>
    <input type="text" maxlength="100" name="dbusername" id="dbusername" />
    </fieldset>
    <fieldset><legend>Password</legend>
    <input type="text" maxlength="100" name="dbpass" id="dbpass" />
    </fieldset>
    <fieldset><legend>Database</legend>
    <input type="text" maxlength="100" name="dbdatabase" id="dbdatabase" />
    </fieldset>
    <fieldset><legend>Next Step</legend>
    <input type="submit" name="submit" id="submit" value="Next Step" />
    </fieldset>
    </form>


    <?php
    }
    }
    }
    elseif(
    $_GET['step'] == "3") { //blbalbalbalab
    How could this hapen to meeeeeeeeeeeeeee?lol.

  7. #7
    Join Date
    Feb 2008
    Location
    Plymouth
    Posts
    346
    Tokens
    0

    Default

    Lmao! it's so annoying isn't it See I built it so if they have the wrong information it says: You need to edit varfunctions.php with the correct database information!
    And just re-directs them back to the install page
    I am Bojangles =]




  8. #8
    Join Date
    Sep 2006
    Location
    Evanston, Illinois.
    Posts
    2,361
    Tokens
    0

    Latest Awards:

    Default

    When I put in right or wrong info mine echos it's error..
    How could this hapen to meeeeeeeeeeeeeee?lol.

  9. #9
    Join Date
    Feb 2008
    Location
    Plymouth
    Posts
    346
    Tokens
    0

    Default

    What this?
    echo "Some of your information is incorrect, please try again.";
    I am Bojangles =]




  10. #10
    Join Date
    Sep 2006
    Location
    Evanston, Illinois.
    Posts
    2,361
    Tokens
    0

    Latest Awards:

    Default

    if info is incorrect.
    How could this hapen to meeeeeeeeeeeeeee?lol.

Page 1 of 3 123 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •