SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    Old Fogey mancroft's Avatar
    Join Date
    Oct 2002
    Location
    lost
    Posts
    445
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Supplied argument is not a valid MySQL-Link

    I am trying to get php to send an email part of which is a display of a MySQL table.
    The code below may or may not be correct but I am getting the error message:
    Warning: Supplied argument is not a valid MySQL-Link resource in /home/mancroft/www/test/emailform.php on line 32
    plus two similar messages for other lines.
    Any ideas please?
    MYSQL_CONNECT(localhost, mancroft, xxxxxx) OR DIE("Unable to connect");

    mysql_select_db("mancroft_test",$db);
    $result = mysql_query("SELECT * FROM cart",$db);
    if ($result === false) die("failed");
    while ($row=mysql_fetch_row($result)) {
    $RBI=$row[0];
    $RUI=$row[1];
    $RON=$row[2];
    }
    $serveroutput = "$RBI $RUI $RON";
    :

    :

  2. #2
    SitePoint Wizard siteguru's Avatar
    Join Date
    Oct 2002
    Location
    Scotland
    Posts
    3,631
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    PHP Code:
    $conn mysql_connect ('server','user','passwd') or die ( "Unable to connect" );
    mysql_select_db ('mancroft'$conn) or die ( "Unable to select database" );

    $result mysql_query ("SELECT * FROM cart"$conn) or die ( "Unable to execute SQL: ".mysql_error());

    while ( 
    $row mysql_fetch_row($result) ) {
        
    $RBI=$row[0];
        
    $RUI=$row[1];
        
    $RON=$row[2];
    }
    $serveroutput "$RBI $RUI $RON"
    Ian Anderson
    www.siteguru.co.uk

  3. #3
    Old Fogey mancroft's Avatar
    Join Date
    Oct 2002
    Location
    lost
    Posts
    445
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanx, siteguru

    wife + credit card = ruin

    I know what you mean!

    :

    :

  4. #4
    SitePoint Wizard siteguru's Avatar
    Join Date
    Oct 2002
    Location
    Scotland
    Posts
    3,631
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    With the above example, bear in mind that $serveroutput will only contain the values from the last row of the returned recordset!
    Ian Anderson
    www.siteguru.co.uk


Bookmarks

Posting Permissions

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