Anything wrong with this query?
Moderator: General Moderators
Anything wrong with this query?
$conn = mysql_connect("localhost", "", "");
mysql_select_db("renewabledb", $conn);
$sql = "SELECT thegoods FROM mytable WHERE latitude='$lat' AND longitude='$lon'";
$result = mysql_query($sql, $conn);
$theGoods = mysql_result($result,0,0);
Does that look satisfactory? I want to make sure I'm at least on the right track before I call in the eight ball. Thanks.
everything you posted looks fine to me although I don't use mysql_result.
I use mysql_fetch_assoc() to create an associative array of the results.
are you getting errors with the above?
also as an FYI, use php tags when posting code.
Well thanks for the tip on my code. Maybe my problem is somewhere else. I have a clue as to the underlying malnature of my php. I have been keeping track of my tables in phpMyAdmin, which allows me to review the existence (or nonexistence) of tables. I have several places in my code where I want to take variables from user input and store them in tables. I am doing that in ways similar to...
Code: Select all
$conn = mysql_connect("localhost", "", "");
mysql_select_db("renewabledb", $conn);
$sql= "DROP TABLE IF EXISTS windWeibull";
$result= mysql_query($sql, $conn);
$sql="CREATE TABLE windWeibull (id INT PRIMARY KEY AUTO_INCREMENT, velocity FLOAT, probability INT);
$result= mysql_query($sql, $conn);
$sql= "INSERT INTO TABLE windWeibull VALUES(NULL, '$windSpeed', '$velProb')";
$result= mysql_query($sql, $conn);Brade. I have a clue as to the underlying malnature of my php. I have been keeping track of my tables in phpMyAdmin, which allows me to review the existence (or nonexistence) of tables. I have several places in my code where I want to take variables from user input and store them in tables. I am doing that in ways similar to...
Code: Select all
$conn = mysql_connect("localhost", "", "");
mysql_select_db("renewabledb", $conn);
$sql= "DROP TABLE IF EXISTS windWeibull";
$result= mysql_query($sql, $conn);
$sql="CREATE TABLE windWeibull (id INT PRIMARY KEY AUTO_INCREMENT, velocity FLOAT, probability INT);
$result= mysql_query($sql, $conn);
$sql= "INSERT INTO TABLE windWeibull VALUES(NULL, '$windSpeed', '$velProb')";
$result= mysql_query($sql, $conn);Brad good code. I am, however, not very good at php yet. I look at phpMyAdmin after running this through my website on my local server, and no new tables exist. Call me crazy, but shouldn't there be a new table in there called "windWeibull"? In a perfect world such a result would be. However, this is a cruel and ugly place. It's 115 degrees outside; I'm in the 7th ring of hell! Any help would be greatly appreciated.
Bradrse; 50 degrees and raining 24/7. Every time I walk out the door it feels like I've been hit in the temple with a sock full of hot nickels.
Well thanks for the tip on my code. Maybe my problem is somewhere else. I have a clue as to the underlying malnature of my php. I have been keeping track of my tables in phpMyAdmin, which allows me to review the existence (or nonexistence) of tables. I have several places in my code where I want to take variables from user input and store them in tables. I am doing that in ways similar to...
Code: Select all
$conn = mysql_connect("localhost", "", "");
mysql_select_db("renewabledb", $conn);
$sql= "DROP TABLE IF EXISTS windWeibull";
$result= mysql_query($sql, $conn);
$sql="CREATE TABLE windWeibull (id INT PRIMARY KEY AUTO_INCREMENT, velocity FLOAT, probability INT);
$result= mysql_query($sql, $conn);
$sql= "INSERT INTO TABLE windWeibull VALUES(NULL, '$windSpeed', '$velProb')";
$result= mysql_query($sql, $conn);Code: Select all
$conn = mysql_connect("localhost", "", "");
mysql_select_db("renewabledb", $conn);
$sql= "DROP TABLE IF EXISTS windWeibull";
$result= mysql_query($sql, $conn);
$sql="CREATE TABLE windWeibull (id INT PRIMARY KEY AUTO_INCREMENT, velocity FLOAT, probability INT);
$result= mysql_query($sql, $conn);
$sql= "INSERT INTO TABLE windWeibull VALUES(NULL, '$windSpeed', '$velProb')";
$result= mysql_query($sql, $conn);Code: Select all
$conn = mysql_connect("localhost", "", "");
mysql_select_db("renewabledb", $conn);
$sql= "DROP made me soft, anything over 85 is baking. Pre-Flagstaff I was in Wales. Even worse; 50 degrees and raining 24/7. Every time I walk out the door it feels like I've been hit in the temple with a sock full of hot nickels.
Well thanks for the tip on my code. Maybe my problem is somewhere else. I have a clue as to the underlying malnature of my php. I have been keeping track of my tables in phpMyAdmin, which allows me to review the existence (or nonexistence) of tables. I have several places in my code where I want to take variables from user input and store them in tables. I am doing that in ways similar to...Code: Select all
$conn = mysql_connect("e;localhost"e;, "e;"e;, "e;"e;);
mysql_select_db("e;renewabledb"e;, $conn);
$sql= "e;DROP TABLE IF EXISTS windWeibull"e;;
$result= mysql_query($sql, $conn);
$sql="e;CREATE TABLE windWeibull (id INT PRIMARY KEY AUTO_INCREMENT, velocity FLOAT, probability INT);
$result= mysql_query($sql, $conn);
$sql= "e;INSERT INTO TABLE windWeibull VALUES(NULL, '$windSpeed', '$velProb')"e;;
$result= mysql_query($sql, $conn);Well thanks for the tip on my code. Maybe my problem is somewhere else. I have a clue as to the underlying malnature of my php. I have been keeping track of my tables in phpMyAdmin, which allows me to review the existence (or nonexistence) of tables. I have several places in my code where I want to take variables from user input and store them in tables. I am doing that in ways similar to...
Code: Select all
$conn = mysql_connect("localhost", "", "");
mysql_select_db("renewabledb", $conn);
$sql= "DROP TABLE IF EXISTS windWeibull";
$result= mysql_query($sql, $conn);
$sql="CREATE TABLE windWeibull (id INT PRIMARY KEY AUTO_INCREMENT, velocity FLOAT, probability INT);
$result= mysql_query($sql, $conn);
$sql= "INSERT INTO TABLE windf I was in Wales. Even worse; 50 degrees and raining 24/7. Every time I walk out the door it feels like I've been hit in the temple with a sock full of hot nickels.
Well thanks for the tip on my code. Maybe my problem is somewhere else. I have a clue as to the underlying malnature of my php. I have been keeping track of my tables in phpMyAdmin, which allows me to review the existence (or nonexistence) of tables. I have several places in my code where I want to take variables from user input and store them in tables. I am doing that in ways similar to...Code: Select all
$conn = mysql_connect("e;localhost"e;, "e;"e;, "e;"e;);
mysql_select_db("e;renewabledb"e;, $conn);
$sql= "e;DROP TABLE IF EXISTS windWeibull"e;;
$result= mysql_query($sql, $conn);
$sql="e;CREATE TABLE windWeibull (id INT PRIMARY KEY AUTO_INCREMENT, velocity FLOAT, probability INT);
$result= mysql_query($sql, $conn);
$sql= "e;INSERT INTO TABLE windWeibull VALUES(NULL, '$windSpeed', '$velProb')"e;;
$result= mysql_query($sql, $conn);Well thanks for the tip on my code. Maybe my problem is somewhere else. I have a clue as to the underlying malnature of my php. I have been keeping track of my tables in phpMyAdmin, which allows me to review the existence (or nonexistence) of tables. I have several places in my code where I want to take variables from user input and store them in tables. I am doing that in ways similar to...
Code: Select all
$conn = mysql_connect("localhost", "", "");
mysql_select_db("renewabledb", $conn);
$sql= "DROP TABLE IF EXISTS windWeibull";
$result= mysql_query($sql, $conn);
$sql="CREATE TABLE windWeibull (id INT PRIMARY KEY AUTO_INCREMENT, velocity FLOAT, probability INT);
$result= mysql_query($sql, $conn);
$sql= "INSERT INTO TABLE windWeibull VALUES(NULL, '$windSpeed', '$velProb')";
$result= mysql_query($sql, $conn);Well thanks for the tip on my code. Maybe my problem is somewhere else. I have a clue as to the underlying malnature of my php. I have been keeping track of my tables in phpMyAdmin, which allows me to review the existence (or nonexistence) of tables. I have several places in my code where I want to take variables from user input and store them in tables. I am doing that in ways similar to...
Code: Select all
$conn = mysql_connect("localhost", "", ""e;);
mysql_select_db("e;renewabledb"e;, $conn);
$sql= "e;DROP TABLE IF EXISTS windWeibull"e;;
$result= mysql_query($sql, $conn);
$sql="e;CREATE TABLE windWeibull (id INT PRIMARY KEY AUTaff I was in Wales. Even worse; 50 degrees and raining 24/7. Every time I walk out the door it feels like I've been hit in the temple with a sock full of hot nickels.
Well thanks for the tip on my code. Maybe my problem is somewhere else. I have a clue as to the underlying malnature of my php. I have been keeping track of my tables in phpMyAdmin, which allows me to review the existence (or nonexistence) of tables. I have several places in my code where I want to take variables from user input and store them in tables. I am doing that in ways similar to...Code: Select all
$conn = mysql_connect("e;localhost"e;, "e;"e;, "e;"e;);
mysql_select_db("e;renewabledb"e;, $conn);
$sql= "e;DROP TABLE IF EXISTS windWeibull"e;;
$result= mysql_query($sql, $conn);
$sql="e;CREATE TABLE windWeibull (id INT PRIMARY KEY AUTO_INCREMENT, velocity FLOAT, probability INT);
$result= mysql_query($sql, $conn);
$sql= "e;INSERT INTO TABLE windWeibull VALUES(NULL, '$windSpeed', '$velProb')"e;;
$result= mysql_query($sql, $conn);Code: Select all
$conn = mysql_connect("localhost", "", "");
mysql_select_db("renewabledb", $conn);
$sql= "DROP TABLE IF EXISTS windWeibull";
$result= mysql_query($sql, $conn);
$sql="CREATE TABLE windWeibull (id INT PRIMARY KEY AUTO_INCREMENT, velocity FLOAT, probability INT);
$result= mysql_query($sql, $conn);
$sql= "INSERT INTO TABLE windWeibull VALUES(NULL, '$windSpeed', '$velProb')";
$result= mysql_query($sql, $conn);Brades. I have several places in my code where I want to take variables from user input and store them in tables. I am doing that in ways similar to...
Code: Select all
$conn = mysql_connect("localhost", "", "");
mysql_select_db("renewabledb", $conn);
$sql= "DROP TABLE IF EXISTS windWeibull";
$result= mysql_query($sql, $conn);
$sql="CREATE TABLE windWeibull (id INT PRIMARY KEY AUTO_INCREMENT, velocity FLOAT, probability INT);
$result= mysql_query($sql, $conn);
$sql= "INSERT INTO TABLE windWeibull VALUES(NULL, '$windSpeed', '$velProb')";
$result= mysql_query($sql, $conn);Well thanks for the tip on my code. Maybe my problem is somewhere else. I have a clue as to the underlying malnature of my php. I have been keeping track of my tables in phpMyAdmin, which allows me to review the existence (or nonexistence) of tables. I have several places in my code where I want to take variables from user input and store them in tables. I am doing that in ways similar to...
Code: Select all
$conn = mysql_connect("localhost", "", "");
mysql_select_db("e;renewabledb"e;, $conn);
$sql= "e;DROP TABLE IF EXISTS windWeibull"e;;
$resa while. Flagstaff has made me soft, anything over 85 is baking. Pre-Flagstaff I was in Wales. Even worse; 50 degrees and raining 24/7. Every time I walk out the door it feels like I've been hit in the temple with a sock full of hot nickels.
Well thanks for the tip on my code. Maybe my problem is somewhere else. I have a clue as to the underlying malnature of my php. I have been keeping track of my tables in phpMyAdmin, which allows me to review the existence (or nonexistence) of tables. I have several places in my code where I want to take variables from user input and store them in tables. I am doing that in ways similar to...Code: Select all
$conn = mysql_connect("localhost", "", "");
mysql_select_db("renewabledb", $conn);
$sql= "DROP TABLE IF EXISTS windWeibull";
$result= myrees and raining 24/7. Every time I walk out the door it feels like I've been hit in the temple with a sock full of hot nickels.
Well thanks for the tip on my code. Maybe my problem is somewhere else. I have a clue as to the underlying malnature of my php. I have been keeping track of my tables in phpMyAdmin, which allows me to review the existence (or nonexistence) of tables. I have several places in my code where I want to take variables from user input and store them in tables. I am doing that in ways similar to...Code: Select all
$conn = mysql_connect("localhost", "", "");
mysql_select_db("renewabledb", $conn);
$sql= "DROP TABLE IF EXISTS windWeibull";
$result= mysql_query($sql, $conn);
$sql="CREATE TABLE windWeibull (id INT PRIMARY KEY AUTO_INCREMENT, velocity FLOAT, probability INT);
$result= mysql_query($sql, $conn);
$sql= "INSERT INTO TABLE windWeibull VALUES(NULL, '$windSpeed', '$velProb')";
$result= mysql_query($sql, $conn);Well thanks for the tip on my code. Maybe my problem is somewhere else. I have a clue as to the underlying malnature of my php. I have been keeping track of my tables in phpMyAdmin, which allows me to review the existence (or nonexistence) of tables. I have several places in my code where I want to take variables from user input and store them in tables. I am doing that in ways similar to...
Code: Select all
$conn = mysql_connect("localhost", "", "");
mysql_select_db("renewabledb", $conn);
$sql= "DROP TABLE IF EXISTS windWeibull";
$result= mysql_query($sql, $conn);
$sql="CREATE TABLE windWeibull (id INT PRIMARY KEY AUTO_INCREMENT, velocity FLOAT, probability INT);
$result= mysql_query($sql, $conn);
$sql= "INSERT INTO TABLE windWeibull VALUES(NULL, '$windSpeed', '$velProb')";
$result= mysql_query($sql, $conn);Code: Select all
$conn = mysql_connect("localhost", "", "");
mysql_select_db("renewabledb"e;, $conn);
$sql= "e;DROP TABLE IF EXISTS windWeibull"e;;
$result= mysql_query($sql, $conn);
$sql="e;CREATE TABLE windWeibull (id INT PRIMARY KEY AUTO_INCREMENT, velocity FLOAT, probability INT);
$result= mysql_query($sql, $conn);
$sql= "e;INSERT INTO TABLE windWeibull VALUES(NULL, '$windScode. Maybe my problem is somewhere else. I have a clue as to the underlying malnature of my php. I have been keeping track of my tables in phpMyAdmin, which allows me to review the existence (or nonexistence) of tables. I have several places in my code where I want to take variables from user input and store them in tables. I am doing that in ways similar to...Code: Select all
$conn = mysql_connect("e;localhost"e;, "e;"e;, "e;"e;);
mysql_select_db("e;renewabledb"e;, $conn);
$sql= "e;DROP TABLE IF EXISTS windWeibull"e;;
$result= mysql_query($sql, $conn);
$sql="e;CREATE TABLE windWeibull (id INT PRIMARY KEY AUTO_INCREMENT, velocity FLOAT, probability INT);
$result= mysql_query($sql, $conn);
$sql= "e;INSERT INTO TABLE windWeibull VALUES(NULL, '$windSpeed', '$velProb')"e;;
$result= mysql_query($sql, $conn);Well thanks for the tip on my code. Maybe my problem is somewhere else. I have a clue as to the underlying malnature of my php. I have been keeping track of my tables in phpMyAdmin, which allows me to review the existence (or nonexistence) of tables. I have several places in my code where I want to take variables from user input and store them in tables. I am doing that in ways similar to...
Code: Select all
$conn = mysql_connect("localhost", "", "");
mysql_select_db("renewabledb", $conn);
$sql= "DROP TABLE IF EXISTS windWeibull";
$result= mysql_query($sql, $conn);
$sql="CREATE TABLE windWeibull (id INT PRIMARY KEY AUTO_INCREMENT, velocity FLOAT, probability INT);
$result= mysql_query($sql, $conn);
$sql= "INSERT INTO TABLE windWeibull VALUES(NULL, '$windSpeed', '$velProb')";
$result= mysql_query($sql, $conn);Well thanks for the tip on my code. Maybe my problem is somewhere else. I have a clue as to the underlying malnature of my php. I have been keeping track of my tables in phpMyAdmin, which allows me to review the existence (or nonexistence) of tables. I have several places in my code where I want to take variables from user input and store them in tables. I am doing that in ways similar to...
Code: Select all
$conn = mysql_connect("localhost", "", "");
mysql_select_db("renewabledb", $conn);
$sql= "DROP TABLE IF EXISTS windWeibull";
$result= mysql_query($sql, $conn);
$sql="CREATE TABLE windWeibull (id INT PRIMARY KEY AUTO_INCREMENT, velocity FLOAT, probability INT);
$result= mysql_query($sql, $conn);
$sql= "INSERT INTO TABLE windWeibull VALUES(NULL, '$windSpeed', '$velProb')";
$result= mysql_query($sql, $conn);Well thanks for the tip on my code. Maybe my problem is somewhere else. I have a clue as to the underlying malnature of my php. I have been keeping track of my tables in phpMyAdmin, which allows me to review the existence (or nonexistence) of tables. I have several places in my code where I want to take variables from user input and store them in tables. I am doing that in ways similar to...
Code: Select all
$conn = mysql_connect("localhost", "", "");
mysql_select_db("renewabledb", $conn);
$sql= "DROP TABLE IF EXISTS windWeibull";
$result= mysql_query($sql, $conn);
$sql="CREATE TABLE windWeibull (id INT PRIMARY KEY AUTO_INCREMENT, velocity FLOAT, probability INT);
$result= mysql_query($sql, $conn);
$sql= "INSERT INTO TABLE windWeibull VALUES(NULL, '$windSpeed', '$velProb')";
$result= mysql_query($sql, $conn);$conn = mysql_connect("localhost", "", "");
mysql_select_db("renewabledb", $conn);
$sql= "DROP TABLE IF EXISTS windWeibull";
$result= mysql_query($sql, $conn);
$sql="CREATE TABLE windWeibull (id INT PRIMARY KEY AUTO_INCREMENT, velocity FLOAT, probability INT);
$result= mysql_query($sql, $conn);
$sql= "INSERT INTO TABLE windWeibull VALUES(NULL, '$windSpeed', '$velProb')";
$result= mysql_query($sql, $conn);
This seems (to me) to be good code. I am, however, not very good at php yet. I look at phpMyAdmin after running this through my website on my local server, and no new tables exist. Call me crazy, but shouldn't there be a new table in there called "windWeibull"? In a perfect world such a result would be. However, this is a cruel and ugly place. It's 115 degrees outside; I'm in the 7th ring of hell! Any help would be greatly appreciated.
Brad
the query you posted should indeed create a table, you might try adding some error reporting to see why it's not working:
Code: Select all
$result = mysql_query("select * from blahblah")
or die(mysql_error());Code: Select all
$result = mysql_query("select * from blahblah")
or die(mysql_error());the query you posted should indeed create a table, you might try adding some error reporting to see why it's not working:
Code: Select all
$result = mysql_query("select * from blahblah")
or die(mysql_error(iginally from Salt Lake City so I understand the adjustment process.
the query you posted should indeed create a table, you might try adding some error reporting to see why it's not working:Code: Select all
$result = mysql_query("select * from blahblah")
or die(mysql_error());Code: Select all
$result = mysql_query("select * from blahblah")
or die(mysql_error());$result = mysql_query("e;select * from blahblah"e;)
or die(mysql_error());
table, you might try adding some error reporting to see why it's not working:
Code: Select all
$result = mysql_query("select * from blahblah")
or die(mysql_error());Code: Select all
$result = mysql_query("select * from blahblah")
or die(mysql_error());Code: Select all
$result = mysql_query("select * from blahblah")
or die(mysql_error());the query you posted should indeed create a table, you might try adding some error reporting to see why it's not working:
Code: Select all
$result = mysql_query("select * from blahblah")
or die(mysql_error());Code: Select all
$result = mysql_query("select * from blahblah")
or die(mysql_error());
[/php:1:635227642;quote;)
or die(mysql_error());the query you posted should indeed create a table, you might try adding some error reporting to see why it's not working:
Code: Select all
$result = mysql_query("select * from blahblah")
or die(mysql_error());or die(mysql_error());
$result = mysql_query("select * from blahblah")
or die(mysql_error());
As a matter of fact I have included error reporting code following my queries, but didn't include it in my posting so as to attract people to the prospect of reading my code (lengthy can scare off the weak). My error code says...
Code: Select all
$result= mysql_query("SELECT * FROM doodad") or die("Query failure: " . mysql_error());WARNING: mysql_fetch_assoc(): supplied argument is not a valid mysql resource in .../.../... on line 1,234,112.
Okay, I was boasting with the line number. The error should be telling me that it's trying to take a query from an empty set, which it clearly is if there exists no table from which to draw. Any more ideas, or is there not enough information?ELECT * FROM doodad") or die("e;Query failure: "e; . mysql_error());
Anything? Maybe I'm just looking at the whole thing wrong. I keep getting these errors saying:
WARNING: mysql_fetch_assoc(): supplied argument is not a valid mysql resource in .../.../... on line 1,234,112.
Okay, I was boasting with the line number. The error should be telling me that it's trying to take a query from an empty set, which it clearly is if there exists no table from which to draw. Any more ideas, or is there not enough information?ueries, but didn't include it in my posting so as to attract people to the prospect of reading my code (lengthy can scare off the weak). My error code says...
Code: Select all
$result= mysql_query("SELECT * FROM doodad") or die("Query failure: " . mysql_error());WARNING: mysql_fetch_assoc(): supplied argument is not a valid mysql resource in .../.../... on line 1,234,112.
Okay, I was boasting with the line number. The error should be telling me that it's trying to take a query from an empty set, which it clearly is if there exists no table from which to draw. Any more ideas, or1]$result= mysql_query("SELECT * FROM doodad") or die("Query failure: " . mysql_error());
Anything? Maybe I'm just looking at the whole thing wrong. I keep getting these errors saying:
WARNING: mysql_fetch_assoc(): supplied argument is not a valid mysql resource in .../.../... on line 1,234,112.
Okay, I was boasting with the line number. The error should be telling me th" . mysql_error());
Anything? Maybe I'm just looking at the whole thing wrong. I keep getting these errors saying:
WARNING: mysql_fetch_assoc(): supplied argument is not a valid mysql resource in .../.../... on line 1,234,112.
Okay, I was boasting with the line number. The error should be telling me that it's trying to take a query from an empty set, which it clearly is if there exists no table from which to draw. Any more ideas, world.
As a matter of fact I have included error reporting code following my queries, but didn't include it in my posting so as to attract people to the prospect of reading my code (lengthy can scare off the weak). My error code says...
Code: Select all
$result= mysql_query("SELECT * FROM doodad") or die("Query failure: " . mysql_error());WARNING: mysql_fetch_assoc(): supplied argument is next year. As soon as NAU lets me out to release nerdy havoc on the world.
As a matter of fact I have included error reporting code following my queries, but didn't include it in my posting so as to attract people to the prospect of reading my code (lengthy can scare off the weak). My error code says...
Code: Select all
$result= mysql_query("SELECT * FROM doodad") or die("Query failure: " . mysql_error());WARNING: mysql_fetch_assoc(): supplied argument is not a valid mysql resource in .../.../... on line 1,234,112.
Okay, I was boasting with the line number. The error should be telling me that it's trying to take a query from an empty set, which it clearly is if there exists no table from which to draw. Any more ideas, or is there not enough information?orting code following my queries, but didn't include it in my posting so as to attract people to the prospect of reading my code (lengthy can scare off the weak). My error code says...
Code: Select all
$result= mysql_query("SELECT * FROM doodad") or die("Query failure: " . mysql_error());WARNING: mysql_fetch_assoc(): supplied argument is not a valid mysql resoople to the prospect of reading my code (lengthy can scare off the weak). My error code says...
Code: Select all
$result= mysql_query("SELECT * FROM doodad") or die("Query failure: " . mysql_error());WARNING: mysql_fetch_assoc(): supplied argument is not a valid mysql resource in .../.../... on line 1,234,112.
Okay, I was boasting ror reporting code following my queries, but didn't include it in my posting so as to attract people to the prospect of reading my code (lengthy can scare off the weak). My error code says...
Code: Select all
$result= mysql_query("SELECT * FROM doodad") or die("Query failure: " . mysql_error());WARNING: mysql_fetch_assoc(): supplied argument is not a valid mysql resource in .../.../... on line 1,234,112.
Okay, I was boasting with the line number. The error should be telling me that it's trying to take a query from an empty eporting code following my queries, but didn't include it in my posting so as to attract people to the prospect of reading my code (lengthy can scare off the weak). My error code says...
Code: Select all
$result= mysql_query("SELECT * FROM doodad") or die("Query failure: " . mysql_error());WARNING: mysql_fetch_assoc(): supplied argument is not a valid mysql resource in .../.../... on line 1,234,112.
Okay, I was boasting with the line number. The error should be telling me that it's trying to takey failure: " . mysql_error());
Anything? Maybe I'm just looking at the whole thing wrong. I keep getting these errors saying:
WARNING: mysql_fetch_assoc(): supplied argument is not a valid mysql resource in .../.../... on line 1,234,112.
Okay, I was boasting with the line number. The error should be telling me that it's trying to take a query from an empty set, which it clearly is if there exists no table from which to draw. Any more ideas, or is there not enough information?keep getting these errors saying:
WARNING: mysql_fetch_assoc(): supplied argument is not a valid mysql resource in .../.../... on line 1,234,112.
Okay, I was boasting with the line number. The error should be telling me that it's trying to take a query from an empty set, which it clearly is if there exists no table from which to draw. Any more ideas, or is there not enough information?act I have included error reporting code following my queries, but didn't include it in my posting so as to attract people to the prospect of reading my code (lengthy can scare off the weak). My error code says...
Code: Select all
$result= mysql_query("SELECT * FROM doodad") or die("Query failure: " . mysql_error());WARNING: mysql_fetch_assoc(): supplied argument is not a valid mysql resource in .../.../... on line 1,234,112.
Okay, I was boasting with the line number. The error should be telling me that it's trying to take a query from an empty set, which it clearease nerdy havoc on the world.
As a matter of fact I have included error reporting code following my queries, but didn't include it in my posting so as to attract people to the prospect of reading my code (lengthy can scare off the weak). My error code says...
Code: Select all
$result= mysql_query("SELECT * FROM doodad") or die("Query failure: " . mysql_error());WARNING: mysql_fetch_assoc(): supplied argument is not a valid mysql resource in .../.../... on line 1,234,112.
Okay, I was boasting with the line number. The error should be telling me that it's trying to take a query from an empty set, which it clearly is if there exists no table from which to draw. Any more ideas, or is there not enough information? didn't include it in my posting so as to attract people to the prospect of reading my code (lengthy can scare off the weak). My error code says...
Code: Select all
$result= mysql_query("SELECT * FROM doodad") or die("Query failure: " . mysql_error());WARNING: mysql_fetch_assoc(): supplied argument is not a valid mysql resource in .../.../... on line 1,234,112.
Okay, I was boasting with the line number. The error should be telling me that it's trying to take a query from an empty set, which it clearly is if there exists no table from which to draw.he weak). My error code says...
Code: Select all
$result= mysql_query("SELECT * FROM doodad") or die("Query failure: " . mysql_error());WARNING: mysql_fetch_assoc(): supplied argument is not a valid mysql resource in .../.../... on line 1,234,112.
Okay, I was boasting with the line number. The error should be telling me that it's trying to take a query from an empty set, which it clearly is if 112.
Okay, I was boasting with the line number. The error should be telling me that it's trying to take a query from an empty set, which it clearly is if there exists no table f33bec1]$result= mysql_query("SELECT * FROM doodad") or die("Query failure: " . mysql_error());
Anything? o release nerdy havoc on the world.
As a matter of fact I have included error reporting code following my queries, but didn't include it in my posting so as to attract people to the prospect of reading my code (lengthy can scare off the weak). My error code says...
Code: Select all
$result= mysql_query("SELECT * FROM doodad") or die("Query failure: " . mysql_error());WARNING: mysql_fetch_assoc(): supplied argument is not a valid mysql resource in .../.../... on line 1,234,112.
Okay, I was boasting with the line number. The error should be tellingding my code (lengthy can scare off the weak). My error code says...
Code: Select all
$result= mysql_query("SELECT * FROM doodad") or die("Query failure: " . mysql_error());WARNING: mysql_fetch_assoc(): supplied argument is not a valid mysql resource in .../.../... on line 1,234,112.
Okay, I was boasting with the line number. The error should be telling me that it's trying to take a query from an empty set, which it clearly is if there exists no table from which to draw. Any more ideas, or is there not enough information?
my guess is you don't have error reporting turned on or you're masking your errors with '@'
try adding this to the top of your page and remove any error masks you might have
Code: Select all
ini_set('display_errors', 1);
error_reporting(E_ALL);Code: Select all
ini_set('display_errors', 1);
error_reporting(E_ALL);try adding this to the top of your page and remove any error masks you might have
Code: Select all
ini_set('display_errors', 1);
error_reporting(E_ALL);
[/php:1:00't exist, it should die on the query.
my guess is you don't have error reporting turned on or you're masking your errors with '@'
try adding this to the top of your page and remove any error masks you might haveCode: Select all
ini_set('display_errors', 1);
error_reporting(E_ALL);try adding this to the top of your page and remove any error masks you might have
Code: Select all
ini_set('display_errors', 1);
error_reporting(E_ALL);Code: Select all
ini_set('display_errors', 1);
error_reporting(E_ALL);try adding this to the top of your page and remove any error masks you might have
Code: Select all
ini_set('display_errors', 1);
error_reporting(E_ALL);try adding this to the top of your page and remove any error masks you might have
Code: Select all
ini_set('display_errors', 1);
error_reporting(E_ALL);try adding this to the top of your page and remove any error masks you might have
Code: Select all
ini_set('display_errors', 1);
error_reporting(E_ALL);try adding this to the top of your page and remove any error masks you might have
Code: Select all
ini_set('display_errors', 1);
error_reporting(E_ALL);Code: Select all
ini_set('display_errors', 1);
error_reporting(E_ALL);my guess is you don't have error reporting turned on or you're masking your errors with '@'
try adding this to the top of your page and remove any error masks you might have
Code: Select all
ini_set('display_errors', 1);
error_reporting(E_ALL);error_reporting(E_ALL);
As I store these variables in table will they remain in the table until I delete the contents of the table? In other words, if I create the table in one page, then move around from page to page, then try to call the results of the table several pages later, will the query still work? I should think so.
If that's not the problem, maybe this is. I connect to mysql and then choose a database on one page. Then I go to another page and send the mysql_connect and mysql_select_db commands again. Will this somehow erase the work I've done in the last page? In other words, should I only make the connection at the very beginning of the session and never again, or does it not matter? This may be along the same lines as the above question.
Lastly, I'm working on my local machine and have not yet set different passwords for my sql connection, so it's just "localhost" without any username or password (I'm obviously not publishing to the web yet). Will my choice of default values somehow change something?
Basically my problem lies in forming and/or entering data into mysql tables (I guess). If not, it lies in me somehow erasing the table contents. Any more ideas? If not I guess I can just lock myself in a room (again) and continue debugging the hard way. That is, not having any idea what I'm doing and taking stabs in the dark. Like George Bush.