Well, I redid the code a bit but it is still blowing up with the same error
message. I also did the echo bit and it returned "Resource id #10". What
ever that is. At least I know its returning something. But when I did
mssql_row_nums($result), it returned the value 0. I'm not sure if this is
where its encountering problems or not. Here is the script that I'm using
for everything. I believe the syntax is correct but let me know if you see
anything out of place.
//check through to see if new category or an existing
if ($_POST["cat_nameID"] = ""){
$cat_name = $_POST["new_cat"];
//insert new category
$new_cat = "INSERT INTO category"
. "(cat_name)";
$new_cat = "VALUES (";
$new_cat = "'{$cat_name}'";
mssql_query ($new_cat);
}
else {
//get active category info
$cat_name = $_POST["cat_nameID"];
$result = mssql_query("SELECT cat_id, cat_name FROM category WHERE cat_id =
'$cat_name'");
}
//get new category info
if ($_POST["cat_nameID"] = ""){
$result = mssql_query("SELECT cat_id, cat_name FROM category WHERE cat_name
= '$cat_name'");
}
//get values for $cat_name
$catID = mssql_result($result,0,"cat_id");
$catName = mssql_result($result,0,"cat_name");
thanks
"Miles Thompson" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Micah,
>
> Echo your SELECT statement to make certain it reads the way it should.
> Test for number of rows returned, or an error - $result probably contains
> nothing, that is it's not pointing to an array.
>
> Miles
>
>
> At 01:23 PM 7/7/2003 -0600, Micah Montoy wrote:
> >Anyone see what is wrong with this?
> >
> >//get category info
> >$result = mssql_query("SELECT cat_id, cat_name FROM category WHERE cat_id
=
> >'$cat_name'");
> >$catID = mssql_result($result,0,"cat_id"); //line 32
> >$catName = mssql_result($result,0,"cat_name"); //line 33
> >
> >I'm getting the error:
> >
> >Warning: mssql_result(): Bad row offset (0) in
> >c:\inetpub\wwwroot\webpage10\example\u_images\act_load_imgs.php on line
32
> >
> >Warning: mssql_result(): Bad row offset (0) in
> >c:\inetpub\wwwroot\webpage10\example\u_images\act_load_imgs.php on line
33
> >
> >
> >thanks
> >
> >
> >
> >--
> >PHP General Mailing List (http://www.php.net/)
> >To unsubscribe, visit: http://www.php.net/unsub.php
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php