| | |
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
php Syntax (Toggle Plain Text)
$user_id=$_POST['UserID']; $password=$_POST['Password']; $query="select * from Customer where UserID = '$user_id' and Password = '$password'"; echo $query; $result=mysql_query($query) or die(mysql_error());
Check what $query prints. Execute the same in phpmyadmin.
oh, and please, next time you post your code, put it in [code] tags.
Last edited by nav33n; Dec 7th, 2007 at 8:54 am.
Ignorance is definitely not bliss!
*PM asking for help will be ignored*
*PM asking for help will be ignored*
•
•
Join Date: May 2009
Posts: 1
Reputation:
Solved Threads: 0
Re: Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result
0
#12 May 13th, 2009
y need some help pls
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in c:\xxxxxxxxx\index.php on line 7
No Template Selected
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in c:\xxxxxxxxx\index.php on line 7
No Template Selected
php Syntax (Toggle Plain Text)
require("dbconfig.php"); $con =mysql_connect ($db_host,$db_user,$db_pass) or die("Error connecting"); mysql_select_db($db_name,$con); $tem="select dir from template where active='1'"; $temr=mysql_query($tem,$con); $temn=mysql_num_rows($temr); line 7 if($temn==0)
Last edited by peter_budo; May 15th, 2009 at 7:14 am. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks) and [icode] (inline code) tags.
Re: Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result
0
#13 May 13th, 2009
•
•
•
•
y need some help pls
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in c:\xxxxxxxxx\index.php on line 7
No Template Selected
require("dbconfig.php");
$con =mysql_connect ($db_host,$db_user,$db_pass) or die("Error connecting");
mysql_select_db($db_name,$con);
$tem="select dir from template where active='1'";
$temr=mysql_query($tem,$con);
$temn=mysql_num_rows($temr); line 7
if($temn==0)
GCS d- s+ a-->? C++(++++) UL+++ P+>+++ L+++ E--- W+++
N+ o K w++(---) O? !M- V PS+>++ PE+ Y+ PGP !t- 5? X- R tv+
b+>++ DI+ D G++>+++ e+ h+>++ r y+
PMs asking for help will not be answered, post on the forums. That's what they're there for.
N+ o K w++(---) O? !M- V PS+>++ PE+ Y+ PGP !t- 5? X- R tv+
b+>++ DI+ D G++>+++ e+ h+>++ r y+
PMs asking for help will not be answered, post on the forums. That's what they're there for.
•
•
Join Date: Oct 2009
Posts: 1
Reputation:
Solved Threads: 0
-2
#14 30 Days Ago
$rsEmpresa = mysql_query($SQLEmpresa,$conexion) or die(mysql_error());
//add the text shown in BOLD, this will atleast display what error you are having
//add the text shown in BOLD, this will atleast display what error you are having
•
•
•
•
when im test in my local machine i dont have any error but when im trying to test in web i have this error, the same DB, the same tables, the same data in both structures any idea????
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/virtual/site244/fst/var/www/html/categoria.php on line 107
PHP Syntax (Toggle Plain Text)
<?php require('conexion2.php'); $SQLEmpresa= "SELECT empresa.cve_Empresa, Nombre, Direccion, pagina, telefono FROM empresa, empresa_Categoria WHERE ".$_GET['cve_Categoria']." = empresa_Categoria.cve_Categoria AND empresa_Categoria.cve_Empresa = empresa.cve_Empresa"; $rsEmpresa = mysql_query($SQLEmpresa,$conexion); $reg = array(); -->line 107 while ($reg = mysql_fetch_array($rsEmpresa)) { $nombre = $reg["Nombre"]; $direccion = $reg["Direccion"]; $telefono = $reg["telefono"]; $pagina = $reg["pagina"]; $cve_Empresa = $reg["cve_Empresa"]; ?>
•
•
Join Date: Sep 2009
Posts: 521
Reputation:
Solved Threads: 61
-1
#15 30 Days Ago
your query is failing for sure, echo the query and post it here.
or else execute the query directly inside the mysql and post ,if any error you got there
or else execute the query directly inside the mysql and post ,if any error you got there
"The discipline of writing something down is the first step towards making it happen."
follow me on twitter
follow me on twitter
•
•
Join Date: Nov 2009
Posts: 7
Reputation:
Solved Threads: 0
-1
#16 19 Days Ago
please help me...even i m getting this error:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\xampp\htdocs\admin_loggedin_search_admin.php on line 35
[code=php]
<?php
$con = mysql_connect("localhost","root","");
if(!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("polling",$con);
$result = mysql_query("SELECT * FROM administrator WHERE $_POST[searchby] like '%$_POST[query]%'");
$found=0;
[LINE 35]while($sri=mysql_fetch_array($result))
{
if($sri['name']!="")
{
$found++;
echo " ".$sri['name']."->".$sri['username']."<br />";
}
}
if($found!=0)
{echo "Found ".$found." results!";}
mysql_close($con)
?>
[code/]
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\xampp\htdocs\admin_loggedin_search_admin.php on line 35
[code=php]
<?php
$con = mysql_connect("localhost","root","");
if(!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("polling",$con);
$result = mysql_query("SELECT * FROM administrator WHERE $_POST[searchby] like '%$_POST[query]%'");
$found=0;
[LINE 35]while($sri=mysql_fetch_array($result))
{
if($sri['name']!="")
{
$found++;
echo " ".$sri['name']."->".$sri['username']."<br />";
}
}
if($found!=0)
{echo "Found ".$found." results!";}
mysql_close($con)
?>
[code/]
0
#17 19 Days Ago
your query doesnt seems right to me... try this
always try to create n store ur query in a separate variable.. helps in debugging.
Hope this helps... cheers!!
PHP Syntax (Toggle Plain Text)
$query = "SELECT * FROM administrator WHERE".$_POST[searchby]."like '%".$_POST[query]."%'"; $result = mysql_query($query);
always try to create n store ur query in a separate variable.. helps in debugging.
Hope this helps... cheers!!
•
•
•
•
please help me...even i m getting this error:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\xampp\htdocs\admin_loggedin_search_admin.php on line 35
PHP Syntax (Toggle Plain Text)
<?php $con = mysql_connect("localhost","root",""); if(!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("polling",$con); $result = mysql_query("SELECT * FROM administrator WHERE $_POST[searchby] like '%$_POST[query]%'"); $found=0; [LINE 35]while($sri=mysql_fetch_array($result)) { if($sri['name']!="") { $found++; echo " ".$sri['name']."->".$sri['username']."<br />"; } } if($found!=0) {echo "Found ".$found." results!";} mysql_close($con) ?>
Last edited by venkat0904; 19 Days Ago at 1:48 am.
Gimme reputation points if u find my post helpful.
use [code] tags wherever applicable
dont start a new thread unless u cant find the topic already on forum.
mark a thread "solved" as soon as u get a solution
use [code] tags wherever applicable
dont start a new thread unless u cant find the topic already on forum.
mark a thread "solved" as soon as u get a solution
0
#19 19 Days Ago
ohhh m so sorry... didn't include the spaces.. my bad.
just add a space after "where" clause and before "like".
should be--
n do make sure that ur "searchby" parameter feeds the column name exactly as in ur table..(upper n lower case are considered different)
try this n lemme know..
cheers!!
just add a space after "where" clause and before "like".
should be--
PHP Syntax (Toggle Plain Text)
$query = "SELECT * FROM administrator WHERE ".$_POST[searchby]." like '%".$_POST[query]."%'";
n do make sure that ur "searchby" parameter feeds the column name exactly as in ur table..(upper n lower case are considered different)
try this n lemme know..
cheers!!
Last edited by venkat0904; 19 Days Ago at 3:29 am.
Gimme reputation points if u find my post helpful.
use [code] tags wherever applicable
dont start a new thread unless u cant find the topic already on forum.
mark a thread "solved" as soon as u get a solution
use [code] tags wherever applicable
dont start a new thread unless u cant find the topic already on forum.
mark a thread "solved" as soon as u get a solution
![]() |
Similar Threads
- Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource (PHP)
- Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource (PHP)
- Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource (MySQL)
- Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource (PHP)
- Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource (PHP)
Other Threads in the PHP Forum
- Previous Thread: Newbie PHP question re:w3schools
- Next Thread: textarea count commas.
| Thread Tools | Search this Thread |
apache api array beginner binary body broken buttons cakephp checkbox class cms code cron curl database date date/time display dynamic ebooks echo email error file files folder form forms function functions global google href htaccess html image include insert ip javascript joomla limit link list login mail mediawiki menu mlm msqli_multi_query multiple mycodeisbad mysql navigation number oop parameter paypal pdf php phpincludeissue problem query radio random recourse recursion regex remote script search seo server sessions sms source sp space speed sql static subdomain syntax system table tag tutorial update upload url validator variable vbulletin video web webdesign white xml youtube






