473,769 Members | 2,088 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 2105
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
2841
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
3437
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
18903
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
3919
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
2713
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
3608
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
1715
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
16983
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
4757
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
9589
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10216
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
10049
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
9997
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,...
1
7413
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5310
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...
1
3965
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3565
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2815
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.