473,734 Members | 2,238 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Warning: mysql_fetch_arr ay(): supplied argument

Hello! All I have a Error message saying that:

Warning: mysql_fetch_arr ay(): supplied argument is not a valid MySQL
result resource in /home/rocks/public_html/colorado3.php on line 32

I have error on this code below:

<html>
<head>
<titleColorad o</title>
</head>
<body>
<h1>Social Security Offices</h1>
</html>
<?php
$con = mysql_connect(" localhost","adm in","*******" );
if (!$con)
{
die('Could not connect: ' . mysql_error());
}

mysql_select_db ("office", $con);

$id = $_GET['id'];

$result = mysql_query("SE LECT * FROM sso WHERE state = $id");

echo "<table border='2'>
<tr>
<th>Address1</th>
<th>Address2</th>
<th>City</th>
<th>State</th>
<th>Zip</th>
<th>Telephone </th>
</tr>";
while($row = mysql_fetch_arr ay($result)) {
$neprocks_offic e = $row->neprocks_offic e; $addr_st1 = $row->addr_st1;
$addr_st2 = $row->addr_st2; $city = $row->city;
$state = $row->state; $zip = $row->zip; $telephone = $row->telephone;

echo "<tr>";
echo "<td>" . $row['addr_st1'] . "</td>";
echo "<td>" . $row['addr_st2'] . "</td>";
echo "<td>" . $row['city'] . "</td>";
echo "<td>" . $row['state'] . "</td>";
echo "<td>" . $row['zip'] . "</td>";
echo "<td>" . $row['telephone'] . "</td>";
echo "</tr>";
}
echo "</table>";mysql_c lose($con);
?>

Mar 14 '07 #1
1 2096
mysql_select_db ("office", $con) or die(mysql_error ());

$result = mysql_query("SE LECT * FROM sso WHERE state = $id") or
die(mysql_error ());

but please also read docs about security - never put $_GET or $_POST
directly into a mysql-query...

my******@gmail. com schrieb:
Hello! All I have a Error message saying that:

Warning: mysql_fetch_arr ay(): supplied argument is not a valid MySQL
result resource in /home/rocks/public_html/colorado3.php on line 32

I have error on this code below:

<html>
<head>
<titleColorad o</title>
</head>
<body>
<h1>Social Security Offices</h1>
</html>
<?php
$con = mysql_connect(" localhost","adm in","*******" );
if (!$con)
{
die('Could not connect: ' . mysql_error());
}

mysql_select_db ("office", $con);

$id = $_GET['id'];

$result = mysql_query("SE LECT * FROM sso WHERE state = $id");

echo "<table border='2'>
<tr>
<th>Address1</th>
<th>Address2</th>
<th>City</th>
<th>State</th>
<th>Zip</th>
<th>Telephone </th>
</tr>";
while($row = mysql_fetch_arr ay($result)) {
$neprocks_offic e = $row->neprocks_offic e; $addr_st1 = $row->addr_st1;
$addr_st2 = $row->addr_st2; $city = $row->city;
$state = $row->state; $zip = $row->zip; $telephone = $row->telephone;

echo "<tr>";
echo "<td>" . $row['addr_st1'] . "</td>";
echo "<td>" . $row['addr_st2'] . "</td>";
echo "<td>" . $row['city'] . "</td>";
echo "<td>" . $row['state'] . "</td>";
echo "<td>" . $row['zip'] . "</td>";
echo "<td>" . $row['telephone'] . "</td>";
echo "</tr>";
}
echo "</table>";mysql_c lose($con);
?>
Mar 14 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
2834
by: josh dismukes | last post by:
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. Thanks for any help that is given. <?php
3
3434
by: Pratchaya | last post by:
Hi Everyone ============================================================== About PHP::: Error/Problem PHP Warning: mysql_fetch_array(): ============================================================== In the past i use my code/script work fine with Mandrake 9.1 - 10.1 ( + apache ,mysql ) Now i move to redhat EL4 with the same code/script
2
18902
by: 00webman | last post by:
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /var/www/html/scripts/07/view_users.php on line 15 Can anyone spot my error?!? Thanks. <?php # Script 7.6 - view_users.php (2nd version after Script 7.4) // This script retrieves all the records from the users table. $page_title = 'View the Current Users'; include ('./includes/header.html');
3
3914
by: petemaxi | last post by:
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in C:\Program Files\xampp\htdocs\tockholes\includes\menu.inc.php on line 9 <div class="left"> <div class="menu"> <div class="boxhead" style="text-align:center;"> <strong>Menu</strong> </div> <br /> <?php require ('includes/db_conn.inc.php'); $query = "select * from menu order by item_order"; $result = mysql_query($query);
1
2709
by: lsmamadele | last post by:
I am getting the following error messages in my search: Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/mamadele/public_html/BESTPLAYS/search.php on line 113 Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/mamadele/public_html/BESTPLAYS/search.php on line 127 My code is below. Any help would be much appreciated. ...
11
3597
by: Breana | last post by:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/breana/public_html/category.php on line 88 ------------------------------------------- It does this when there is no result "empty table" how can i do a quick fix to say No Results... row 88: if ($myrow = mysql_fetch_array($result)) { do { if ($rowcolor == 1) {
7
1711
by: Jamesking56 | last post by:
I got this error TWICE on my script and i don't know why here is my script: <?php require_once("db.inc.php"); ?> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
2
16977
by: poreko | last post by:
I am connecting to my database using Object oriented PHP. My query is returning results but at the end of my table,at the bottom of the page I keep having this error when I run my program: Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in C:\xampp\htdocs\mysql_class_2.php on line 45. Can anyone help me? The following is my PHP class: <?php class mysql {...
11
4749
by: chemlight | last post by:
I'm having a problem. I'm sure I'm going to kick myself over the answer... I have a table that stores vendors and their languages. This table starts out blank. I am querying the table to see if a vendor has been added to the table yet. The problem is, if they haven't been added, I can't seem to get the script to realize that. here is what I am trying to do. $testvend = SELECT language FROM vendor_details WHERE id = $vendorid ...
0
9459
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9319
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9248
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9191
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8193
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6041
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4555
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
2735
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2185
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.