Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    PHP




Another Invalid Result Resource


Sorry to ask a debugging question, but I've been fooling with this thing all day, and I can't see what the problem is. $query is passed from search form:

$result = mysql_query("select id, date, title, text, reviewer, email, score, cover, url, url_title, hits, type, creator, release, upc, quote from one7_reviews where title LIKE '%$query%' OR description LIKE '%$query%' OR creator LIKE '%$query%' OR url_title LIKE '%$query%' ORDER BY title ASC");

$num = mysql_num_rows($result);

I keep getting "Supplied argument is not a valid MySQL result resource "




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Invalid MySql Result Resource
I have written a php script to search a MYSQL database and with the line:

$result = mysql_query ("SELECT * FROM table1
WHERE first_name LIKE '$first_name%'
AND last_name LIKE '$last_name%' " );
The next line,
if ($row = mysql_fetch_array($result)) { , gives me the error message

"supplied argument is not a valid MySql result resource"

Invalid MySQL Result
I keep getting the following two errors:

Warning: Supplied argument is not a valid MySQL result resource in /home/xxx/public_html/articlepro/newarticle.php on line 75

Warning: Supplied argument is not a valid MySQL result resource in /home/xxx/public_html/articlepro/newarticle.php on line 84

Here's the code which I think is causing the problem. PHP Code:

MySQL Result Resource
I want to build a function that, depending on the input, will either return the results from a MySQL query or do something else and return one of several messages.

My problem is checking the return value to see which is returned. Is there a php function that checks a variable to see if it is a valid MySQL result resource? I looked through the manual and couldn't find anything.

Query Result = Resource ID #10
I have an array $countertop.... i run through each one like this.
PHP Code:

Supplied Argument Is Not A Valid MySQL Result Resource
Before I get in trouble, I have searched extensively for this one, in the
PHP Docs, online etc.

I have a simple page:

<?php

$un="jim";
$pw="jim";
$db="localhost";

$link = mysql_connect($db,$un,$pw) or die("Could not connect: " .
mysql_error());

$sql2 = "SELECT * FROM eib.book ORDER BY bookid";
$op = mysql_query($sql2) ;
$num= mysql_numrows($op);

?>

When I run the page I keep getting this error:

Warning: mysql_numrows(): supplied argument is not a valid MySQL result
resource in C:Program FilesApache
GroupApache2htdocseibphpitemadd2.php on line 34

Supplied Argument Is Not A Valid MySQL Result Resource
I'm pretty new to PHP and I'm trying to modify a script and all the time I keep getting this error: Supplied argument is not a valid MySQL result resource in /public_html/articles.php on line 162 Code:

Warning: Supplied Argument Is Not A Valid MySQL Result Resource
<?
Warning: Supplied argument is not a valid MySQL result resource
if (mysql_num_rows($result) >0 )
!Didnt have this problem before


session_start();

if ($username && $password)
{
// if the user has just tried to log in

$db_conn = mysql_connect("localhost", "*****", "*******");
mysql_select_db("micro_db.adf", $db_conn);
$query = "select * from users "
."where name='$username' "
." and pass=password('$password')";
$result = mysql_query($query, $db_conn);
if (mysql_num_rows($result) >0 )
{
// if they are in the database register the username
$valid_user = $username;
session_register("valid_user");
}
}
?>

Warning: Supplied Argument Is Not A Valid MySQL Result Resource
Warning: Supplied argument is not a valid MySQL result resource in /home/samcoleb/public_html/addnews.php on line 30
error

PHP Code:

Mysql_num_rows(): Supplied Argument Is Not A Valid MySQL Result Resource
I thought for sure I had this query correct, but for some reason, it isn't working. I get this error:

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in......

I am working on a search for my DB. Nothing advance yet, just one input field for the search keyword. Here is my query:

Mysql_fetch_array(): Supplied Argument Is Not A Valid Mysql Result Resource
i recieve this error from this part of the code:

mysql_fetch_array(): supplied argument is not a valid mysql result resource

it's returning a long text from the database which is about 200 characters long.

<?php
if ($_SESSION['is_town'] = 1){
$query = "SELECT usemap FROM town WHERE town_id = " . $_SESSION['townID'][0];
$db_result = mysql_query($query);
$db_usemap = mysql_fetch_array($db_result);
echo $db_usemap;}
?>

Mysql_free_result Return Error Saying Not Valid Mysql Result Resource
im trying to do a query which takes rows of large amounts of text data
and displays them one after another. the size of the fields is causing
the page to be massive in size. so to try and reduce this im trying to
use mysql_free_result to clear the contents from memory.

however its returning an error saying not valid mysql data when im
certain that it is.

is this because im using a while loop like this...?

($row = mysql_fetch_result($result)) {
mysql_free_result($result);
}

Mysql_num_rows(): Supplied Argument Is Not A Valid MySQL Result Resource
I've got the following error:
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/wbdfdart/public_html/wbdfforum/verwijder.php on line 13

verwijder.php

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php
include "connect.php";

if (isset ($cat) AND isset ($topic) AND isset ($message)) {
$query = "SELECT user FROM reply WHERE id='$message'";
$exec = mysql_query($query);
$result = mysql_fetch_array($exec);
$owner = $result["user"];

$moderator_check_query = "SELECT * FROM moderator WHERE category=$cat AND user=$myid";
$moderator_check_exec = mysql_query($moderator_check_query);
$moderator_result = mysql_num_rows($moderator_check_exec);

if ($moderator_result == 1 OR $owner == $myid) {
$moderator = 1;
}

else {
$moderator = 0;
}

if ($moderator == 1) {
$replydelete_query="DELETE FROM reply WHERE id ='$id'";
mysql_query($replydelete_query) or die(mysql_error());
$topicmineen_query="UPDATE topic SET replies='replies -1' WHERE id='$topic'";
mysql_query($topicmineen_query) or die(mysql_error());
echo "<script>location.href='index.php?cat=".$cat."&topic=".$topic."&page=".$page."'</script>";

}

else {
echo "<script>location.href='index.php?cat=".$cat."&topic=".$topic."&page=".$page."'</script>";
}}
?>

"Supplied Argument Is Not A Valid MySQL Result Resource"
this is one of the first scripts im writing completely by myself but its driving me crazy. the errors its returning are:

Quote: Warning: Supplied argument is not a valid MySQL result resource in c:apachehtdocsquiz_chap12_view.php on line 16

There are currently in the table: PHP Code:

NOW() Invalid
$datatime=NOW()it show invalid..

IIS+PHP: The Directory Name Is Invalid.
I have recently migrated from win98+PWS to winXP+IIS, and after that an
problem has occured. When I open some of my PHP pages, I get this
instead of the page I shlud get:

<html><head><title>Error</title></head><body>The directory name is
invalid. </body></html>

Now, the interesting part is the fact that this doesn't happen every
time I try to open a specific page (it happens in 80% of cases, but
sometimes it (the page) just opens like nothing's wrong) and that it
happens on all of my PHP pages! I presume I have misconfigured IIS...
but I don't know where to start searching for a problem... does IIS have
logging? Does PHP have logging?

Or, has anybody encountered similar problem?

I use:
IIS 5.1
PHP Version 4.3.0
IE 6.0

Invalid Query
I want to create a MySQL table from PHP.

$sql = "CREATE TABLE table_name (something VARCHAR(13), something INT)";
$result = mysql_query($sql)

This table is never created. Do you know why? Are there any limitations at making tables from PHP?

PHP Returns Invalid XML Because Of '&'
I'm writing a PHP script to query a database table and return the result as XML. If the result contain the letter '&', the XML is corrupted. How can I fix this problem?

<xml>
<record id='2' text='jjjj&kkkk'>any</record>
</xml>

Displaying Result 1-8, Then Result 9-17 Etc.
I dispaly the results from the database like this.

<? while ($row = mysql_fetch_array($prod_result)) {
$small = $row[0];
echo"<td align=center><img src="produkter/hardware/decks/$small"></strong></td>";}?>

But if there are more than 8 results, I wnat to dispaly the first 8 on one page, then the next 8 on the next page...How can this be done?

Invalid Argument Supplied ?
i am somewhat of a newbie and and having hell with this Script. WHen i run it i get :
Warning: Invalid argument supplied for foreach() in C:InetpubwwwrootKubemailWWWaspedit1.php on line 20

And i cant figure out WHY.
Please help!
Code pasted Below.

<?
$Reg = new COM("IISSample.RegistryAccess");

$Aliases="HKEY_LOCAL_MACHINESOFTWAREIpswitchImailDomainskubemail.comUsers\_aliases";
?>

<?

function EchoValues($strKeyName){

echo "<h3>Get values of ".$strKeyName."</h3>";

$reg->Values[$strKeyName];
echo "<b># subkeys = ".$Values.$Count."</b><br>";

echo "<table>Values Collection";
echo "<TR><TH align=left>Name</TH>".
"<TH align=left>Value</TH></TR>";

foreach($Values as $k){

echo "<TR><TD>".$k.$Name."</TD>";
}

}
?>
<? EchoValues($Aliases); ?>

Bad Request + Invalid Characters
I have a problem with ordering system I've made with PHP.

When user wants to remove items from shopping cart he/she choose the following link:

<a href=remove.php?confirm=yes&name=$name&item_id=$item_id>Yes</a>

One user claimed that he gets the error message below when using NN 6.2. For me everything works fine both with NN 6.2 and IE.

" Bad Request
Your browser sent a request that this server could not understand.
The request line contained invalid characters following the protocol string."

What could cause this error message? Is there someting wrong with the variables in URL? What are the limitations when sending variables in URL?

Where I could find more information about the issue?

PHP/mysql Invalid Character
We are experiencing a problem with displaying text stored in a mysql database. At the end of most of the sentences being out put is a capital E with a carot above it.

(an E with an ^ on top pretty much)

When I look at the database from mysql control center it looks fine, but in vi the character shows up as a?.

Has anyone ever experienced anything like this before. We are a bit stumped on this issue and any help would be appreciated.

Passing Invalid Variables.
let's say a user enters an url like "page.php?id=" or "page.php?id=XRY$%@%#", the url is invalid right? cos there's no id stated there or the id is invalid.

what would happen if i don't do error checking? does the database connection stays on and wastes server memory space? could some hacker clog up the server's memory with multiple error requests?

Session Id Contains Invalid Characters
I am getting this error with php 4.4.0 (cgi mode), apache 1.3.26 on debian
woody:

[01-Nov-2005 03:31:06] PHP Warning: session_start(): The session id
contains invalid characters, valid characters are only a-z, A-Z and 0-9 in
/home/m2004018/DOMAIN.de/shop1/includes/application_top.php on line 270
[01-Nov-2005 03:31:07] PHP Warning: Unknown(): The session id contains
invalid characters, valid characters are only a-z, A-Z and 0-9 in Unknown on
line 0
[01-Nov-2005 03:31:07] PHP Warning: Unknown(): Failed to write session data
(files). Please verify that the current setting of session.save_path is
correct (/home/m2004018/tmp) in Unknown on line 0

The PHPSESSID in the browser address bar looks normal:
index.php?cPath=3&XTCsid=cdfb58872455c72c81dafa5026e6dd92

This is an oscommerce (actually xt:commerce) shop and currently it fails to
send order-mails (to shop owner) or sends empty mails to the customer.

The Format Of QUERY_STRING Is Invalid.
Why am I getting this msg on localhost?

Invalid Characters In URLs
I'm trying to develop my own sitemap generator. If I have a (1 quarter) symbol in the URL to be generated, I need to convert the symbol to a URL friendly equivalent. Previously, the 3rd part sitemap generator converted this symbol to &#188; yet I can only convert to &frac14; using htmlspecialchars/htmlentities which Google rejects.

Resource Id #3
I'm not sure what the problem is, but here's the relevant part of the code:

$result = mysql_query("SELECT * FROM table_1 ORDER BY rec_id DESC LIMIT 0, 20");


after this, when I do
print_r($result);
the output is: "Resource id #3"

and later in the code, when I do this:
$row = mysql_fetch_array($result);

I get the following error in my apache error.log file:
PHP Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in guestbook.php on line 36

Resource ID? Resource Id #71
Can anybody please suggest to me where I can look up what a Resource id #71
is? No success so far looking for what the resource codes are on the net....

Resource Id #2
I'm getting "Resource ID #2" whenever I query on my database (mysql) using PHP. Any idea why that is so? PHP Code:

Resource Id #4
I am trying to acess the Databse to get a username and echo it out..But for some reason it gives that error (See title ) I have no idea what it means.

Resource Id #5
i have this annoying little problem when trying to see the rank of a user, this is the simple bit of code im using...

$result = (mysql_query("SELECT rank FROM users WHERE username = '$username'"));
if ($result == "admin") {
echo "You are an admin.";
}else{
echo "You are not an admin";
echo $result;
}

Even though the user is an admin, the output i get is... "You are not an adminResource id #5"

How Can I Check My Username Of Invalid Characters
i wanna check my usernam of invalid caracters
the valid caracters are a-z 0-9.

Scanning A String For Invalid Characters
Does anyone know a way of scanning a string to find invalid characters such as Ð or Ô and return a true or false?

I thought it was the "htmlentities" function, but all that does is convert invalid characters to the ascii code.

Invalid T_STRING In Print Statement?
I'm working on a small script but when I tried to spice it up a bit with css and a table, I got a T_STRING error on this line:

Strtotime Accepting Invalid Values
I'm using strtotime to validate a date/time passed in from a form but
am having some problems with it. It seems to allow invalid values,
such as "2004-04-13 21:66:13".

Does anyone know why this is? Is this a bug or a "feature"?

I'm using PHP 4.3.2.

PHP Calls To MySQL Using Invalid Characters
I have the following PHP code which constructs a MySQL call: PHP Code:

Invalid Argument Supplied For Foreach()
Invalid argument supplied for foreach() is it right way to use JOIN and let say value of fk_t_directories=312 so i tried to use <?=$r->sys_pk ?> as this value im getting from
PHP Code:

Invalid Login - Corrupt Database?
I recently tried to login into my movable type admin menu, but movable
type tells me "invalid login" all the time. I am running my site on
movable type for about 1 year now and I never had any problem with the
system at all. Please help me because I need to update my site
(designspotter.com) as soon as possible.

I read in a forum that one reason for that could be a database update
of my provider?

$_SESSION['variable_name'], Invalid XHTML And &
The w3 validator identifies the ampersand character as the
leading character for special character sequences. And as
such, all ampersands should be converted to &amp; when
employed as part of a URI. So I configured that manually,
for my own parameters. However, I think what I'm seeing
here with the validator, is that the validator does not activate
cookies and thereby PHP automatically adds an <input>
tag with the PHPSESSID.

Can anyone tell me how to get PHP to employ the &amp;
character in such cases?

Also, do any security risks exist? Should I be parsing the
address line passed and checking to see if anyone is trying
to pass <?PHP tags in that line?

The variables working there, are some $_GET['$iPic'] and
$_GET['$iCategory'] placed inside the hidden form input tags.
I'm seeing that PHP automatically adds an extra <input> tag?
Is that correct?

Trying To Catch An Invalid Image File
I am having trouble trying to get and invalid image. I made a text file then named it test.jpg to test with. I can't seem to find a way to check it i have tried at a lot of test and they fail. I have tried Code:

Invalid Argument Supplied For Foreach()
I dont know why i am getting this error "Warning: Invalid argument supplied for foreach() in /home/content/w/i/u/wiuartinny/html/upload_action.php on line 6" for the following: Here is a form where a user can specify how many uploads they would like to perform. Code:

Array Processing - Invalid Argument
I have been trying to get this working all afternoon. I am writing a script to process a huge survey and store the form values in a database. EVERYTHING works but this one array (from HTML form). I'm sure it is a small problem.

Here is the error (I echo other arrays to test that my loop works properly before and after the one with the problem, as can be seen by the printed values.):

Web Developers Client Services Database Developers Web Developers Marketing Consulting Database Developers

Warning: Invalid argument supplied for foreach() in /export/home/sevanet/twright/public_html/clientsurvey/temp/survey_handler.php on line 44 Code:

Invalid Argument Supplied For Foreach()
I'm getting PHP Warnings about an "Invalid argument supplied for foreach()". Below is my code and the warning relates to the last section which is trying to loop the relevant array. Code:

Identifying If The User Has Placed Invalid Characters
what would the code look like if you wanted to tell the user their info they submitted into a form had invalid characters? would you use ereg?

Resource ID #1 Error
Can anyone explain why I get the above error with the following php file

<?php
$xmlcontents =
fopen("http://miranda.hemscott.com/servlet/HsPublic?context=ir&client=bwd&pa
th=trading&service=getDelayedPrices&market=LSE&symbol=BWD&transform=bwd_lse_
prices_xml", "r");
echo($xmlcontents);
?>

SNMP W/ PHP Resource
I have been programming in PHP for a few years, but now I have a project that requires the use of SNMP with PHP. I have looked over the PHP manual on it, but I am not as familiar with SNMP.

Dual Array: For Detecting Invalid GET Values?
I'm not sure what the terminology of it would be but I would like to do what I'm referring to in my head as a dual array or maybe a parallel array? I have a list of properties that can be manipulated with certain values. However I would like to detect when a GET request with a non-existent property or an invalid value occurs. I'm using CSS terminology here too so let me clarify visually...

Array Sample
property, value,
(
audio, 0,
audio, 1,
audio, 2,
bandwidth, 1,
bandwidth, 2,
browserpatch, 0,
browserpatch, 1,
dhtmleffects, 0,
dhtmleffects, 1,
dhtmlengine, 0,
dhtmlengine, 1,
dtd, t,
dtd, s,
dtd, 1,
dtd, 2,
mediatype, xx,
mediatype, ax,
mediatype, tx,
mediatype, th,
ieccss, 0,
ieccss, 1,
powerkeys, 0,
powerkeys, 1,
theme, classic,
theme, cityblue,
theme, emerald,
theme, lavender,
)

These are examples of my working properties and values. If I could keep the list like it is right now with minor modifications to get it working it would be great as I plan on adding further options in the future. However I'm not exactly sure how I should approach this.

Also this is important as I have tested invalid values and it broke the page once while being served as application/xhtml+xml so this could potentially lead to loosing visitors if I do not address this issue. Suggestions to create this error handler script?

PHP Configuring Problem: Invalid Host Type
Im trying to follow the php installation notes on the site here but Ive hit a snag during the config stage. Here is the command Im using & then Ill throw out the errors:

./configure --with-mysql=/usr/local/bin --with-apache=/usr/local/apache --enable-track-vars

And here are the errors Im getting (all seeming to relate to apache)

configure: warning: --with-apache=/usr/local/apache : invalid host type
configure: error: can only configure for one host and one target at a time

I have to say I am new at this, I built my first Redhat 8 box last weekend & have been "learning as I go" Im using Apache 2.0.44, php 4.3.2 & Mysql 3.23 with the jsdk1.4.1 also installed Apache is running fine & so is MySQL, I just need to get PHP running & then a servlet engine.

Authenticating Name And Password. Not Stopping Invalid Pass's!
I am making (oh boy, theres those scary three words) a news publishing system of my own and I am having problems getting the log in part of the script to work. I save the password and email address in a file called author name.info.

The log in page has two forms, author and password. Heres my php code on the authenticating page PHP Code:


Copyright 2005-08 www.BigResource.com, All rights reserved