Jump to content

Glasgow-Guy

Members
  • Posts

    12
  • Joined

  • Last visited

Posts posted by Glasgow-Guy

  1. Thanks DavidAm

     

    Truly appreciated.

    I do think it will be back onto the learning drawing board.

    I admit I'm only just starting out and its enjoyable working it out etc..,

    I'm at a level of html, xhtml, css and well into javascript, so im onto php,mysql and taking a peek at others while i progress.

     

    But as you know, it's learning each steps and not jumping too far ahead which maybe I'm doing. sometimes it works! sometimes it doesn't!

     

    Forums like these are great because its people who are well far advanced that take time out ot help the novices learn

     

     

    Regards

     

    Glasgow-Guy

     

    No matter what keep learning

  2. Hi DavidAm Thanks for the quick reply

     

    I think your right, it could go on and on if I dont.

    The site is already configured with mysql but is working on a different database that I don't know much about.

    I threw the pages onto that site as I know its already running a mysql database.

     

    Ive only uploaded the search box test pages to throw myself in the deep end and see if it can work.

    I still don't fully understand mysql databases yet, but I'll get there.

     

    I've got quite a few tutorials to go through so I'll suppose I'll get on it

     

     

    Thanks

     

    Glasgow-Guy

  3. My localhost is on :8080

    So I have tried the following code on the results page and they all bring up errors

     

     

     

    mysql_connect(“localhost”, "root", "");

    mysql_select_db("databasefirst");

     

    and

     

    mysql_connect(“localhost:8080”, "root", "");

    mysql_select_db("databasefirst");

     

    and

     

    mysql_connect(“localhost8080”, "root", "");

    mysql_select_db("databasefirst");

  4. Hi David AM

     

    I have justed chnage my 'domain name' with the the word 'domain'

     

    Warning: mysql_connect() [function.mysql-connect]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /home/17536/windowquote/www.domain.co.uk/public_html/testengine/results.php on line 33

     

    Warning: mysql_select_db() [function.mysql-select-db]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /home/17536/windowquote/www.domainco.uk/public_html/testengine/results.php on line 34

     

    Warning: mysql_select_db() [function.mysql-select-db]: A link to the server could not be established in /home/17536/windowquote/www.domain.co.uk/public_html/testengine/results.php on line 34

     

    Warning: mysql_query() [function.mysql-query]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /home/17536/windowquote/www.domain.co.uk/public_html/testengine/results.php on line 36

     

    Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /home/17536/windowquote/www.domain.co.uk/public_html/testengine/results.php on line 36

     

    Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/17536/windowquote/www.domain.co.uk/public_html/testengine/results.php on line 37

    No results found for "contact"

    Warning: mysql_close(): no MySQL-Link resource supplied in /home/17536/windowquote/www.domain.co.uk/public_html/testengine/results.php on line 56

     

     

    Regards

     

    Glasgow-Guy

  5. Hi Pikachu 2000

     

    No I suppose I dont

    But its a test page for a search box and as stated above I'm a novice.

    If I learn by my mistakes fine but as long as it doesn't effect the site then great.

     

    The site that run with its mysql database is a buisness site, the search box that I would hope to eventually build and have working is for a free tourism site that is quite big and already running.

     

    We would all love to have a great site that works perfectly and that never has problems with bad coding/wrong coding, hackers etc..

     

    Wish I had one of the perfect sites but I have a very very long way to go before I feel in total control

     

     

    Regards

     

    Glasgow-Guy

  6. I have just changed it over, everything is the same but its now on a different server for one of my other websites.

    On this site that I have included the test pages has its own mysql database that is working and was built for my by someone else.

    I've just tested it and the following happened

     

    Warning: mysql_connect() [function.mysql-connect]: Unknown MySQL server host 'http' (1) in /home/17536/windowquote/www.domain.co.uk/public_html/testengine/results.php on line 33

     

    Warning: mysql_select_db() [function.mysql-select-db]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /home/17536/windowquote/www.domain.co.uk/public_html/testengine/results.php on line 34

     

    Warning: mysql_select_db() [function.mysql-select-db]: A link to the server could not be established in /home/17536/windowquote/www.domain.co.uk/public_html/testengine/results.php on line 34

     

    Warning: mysql_query() [function.mysql-query]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /home/17536/windowquote/www.domain.co.uk/public_html/testengine/results.php on line 36

     

    Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /home/17536/windowquote/www.domain.co.uk/public_html/testengine/results.php on line 36

     

    Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/17536/windowquote/www.domain.co.uk/public_html/testengine/results.php on line 37

    No results found for "contact"

    Warning: mysql_close(): no MySQL-Link resource supplied in /home/17536/windowquote/www.domain.co.uk/public_html/testengine/results.php on line 56

  7. Hi Bashy

    Thanks fur reply.

     

    Soz

     

    Below I will add the full PHP from my results page

     

    and after that the results that occured.

    p.s. the address I've put down as 'domain' as I've hidden my own address I'm not to sure if I would be allowed to show my own domain on forum post

     

     

    TEST PAGE CODE

    <form action=http://www.domain.co.uk/testengine/results.php" method="get">

    <input type="text" name="input" size="50" value='<?php echo $_GET ['input']; ?>' class="search-field" />

     

     

    <input type="submit" value="search" class="search-button" />

    </form>

    </center>

     

    <hr />

    <?php

    $input = $_GET['input'];//Note to self $input in the name of the search field

    $terms = explode(" ", $input);

    $query = "SELECT * FROM search WHERE " ;

     

    foreach ($terms as $each) {

    $i++;

    if ($i == 1)

    $query .= "keywords LIKE '%each%' ";

    else

    $query .= "OR keyword LIKE '%each%' ";

    }

     

    // connect to database below

    mysql_connect(http://www.domain.co.uk, "root", "");

    mysql_select_db("databasefirst"); // database name is databasefirst

    $query = mysql_query ($query);

    $numrows = mysql_num_rows($query);

    if ($numrows > 0){

     

    while ($rows = mysql_fetch_assoc($query)){

    $id = $row['id'];

    $title = $row['title'];

    $description = $row['description'];

    $keywords = $row['keaywords'];

    $link = $row['link'];

    echo "<h2><a href='$link'>$title</a></h2>

    $description<br /><br />";

     

    }

     

     

    }

     

    else

    echo "No Results Found for \"<strong>$input</strong>\"";

     

    // disconnect

    mysql_close();

     

     

     

    ?>

     

     

     

    Results after running test

    Warning: mysql_connect() [function.mysql-connect]: Unknown MySQL server host 'http' (1) in /home/545/connery/www.domain.co.uk/public_html/testengine/results.php on line 36

     

    Warning: mysql_select_db() [function.mysql-select-db]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /home/545/connery/www.domain.co.uk/public_html/testengine/results.php on line 37

     

    Warning: mysql_select_db() [function.mysql-select-db]: A link to the server could not be established in /home/545/connery/www.domain.co.uk/public_html/testengine/results.php on line 37

     

    Warning: mysql_query() [function.mysql-query]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /home/545/connery/www.domain.co.uk/public_html/testengine/results.php on line 38

     

    Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /home/545/connery/www.domain.co.uk/public_html/testengine/results.php on line 38

     

    Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/545/connery/www.domain.co.uk/public_html/testengine/results.php on line 39

    No Results Found for "contact"

    Warning: mysql_close(): no MySQL-Link resource supplied in /home/545/connery/www.domain.co.uk/public_html/testengine/results.php on line 60

     

     

     

     

    Hope someone can help

     

    Regards

     

    Glasgow-Guy

  8. Hi all and Happy New Year

    Hope you all had a fantastic time

     

    It's 5.55 am here in the UK and I've been up for the past 4 hours trying to get my search engine box to work.

     

     

    I have followed a tutorial in putting a search engine on a webpage.

    I created my database with 5 fields etc.., all went well

    I made a search page and I made the results page.

    I uploaded them to a folder call testengine ( I haven't connected it to my site, it just stands alone for testing)

     

    My problem is I know I've got it wrong for the results page to connect to the database but can't figure it out.

     

    I have on the results page the following php code:

    mysql_connect("localhost", "root", "");

    mysql_select_db("databasefirst");

     

    I am getting the errors in my lines 36 and 37 which means its the two lines quoted above.

    I have changed localhost to other names including 'localhost8080', 'localhost:8080', 'www.mydomainname.co.uk',

    My username is 'root' and my password is blank just the usual.

     

    I logged into 'localhost/myphpadmin' and made the database.

    I watched the tutorial and made the pages but I also downloaded the files as the tuorial allowed me to look at the code.

    There were a couple of corrections that I had to make but everything seems fine, its just connecting.

     

     

    Can anyone help, I am a novice but slowly getting there, I think !!!

     

    Regards

     

    Glasgow-Guy

  9. HI Guys

     

    First time here and I'm hoping someone can help

    I've just started to learn PHP and I'm onto databases

     

    The problem I have that once I log into 'phpmyadmin' and then I click through to databases to make a database but once there, there is text in red which reads "no privileges".

     

    I use Xampp and everything is going well so I know it means I don't have privileges on my own computer to make a database.

    So my question is where do I find the folder/file to make the changes and once I find the file what code do I add and where do I add it in the file. I've looked in the following folders in my 'C:drive', which are php, mysql and xampp but nothing is there to let me know which file to change.

     

    As I said I'm a novice but the database section is holding me back

     

     

    Hope someone can help

    Thanks guys

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.