Richard Davey wrote:
Hello Alistair,

Wednesday, March 10, 2004, 11:26:53 PM, you wrote:

AH> I get this error: mysql_num_rows(): supplied argument is not a valid
AH> MySQL result resource

Then your database connection failed OR the SQL query did. Check those
steps over before anything else.

Maybe post that part of your code so we can see?

AH> Question: Where you have the //do stuff comment, I assume this is where
AH> my HTML code will go. But can I put it between the open brackets? I.E:
AH> {
AH> html code
AH> }

Yes like so:

{
?>
html here
<?
}

Just like in ASP :)


<?php


unset($type);
$type = $_GET['type'];

$link = mysql_connect('localhost', 'user', 'password');
        if (!$link) {
        echo "Couldn't make a connection!";
        exit;
    }
        $db = mysql_select_db("sealhouse", $link);
        if (!$db) {
        echo "Couldn't select database!";
        exit;
    }
$sql= "SELECT * FROM table WHERE type=$type ORDER BY style";
$result = mysql_query($sql);

$total_records = mysql_num_rows($result);

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to