Page 1 of 1

Anything wrong with this query?

Posted: Fri Jul 08, 2005 4:50 pm
by bwv2
Before ripping out the rest of my hair in my debugging efforts, I would like to check that my querying format is not fundamentally wrong. Below is a sample of my code that is repeated in many different ways throughout my would-be website. In theory, should this work?...

$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.

Posted: Fri Jul 08, 2005 5:36 pm
by Burrito
it's gotta be this heat down here that's killing you...I can only take a few more days of the 115 before I start pulling my hair out too 8O

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.

Posted: Fri Jul 08, 2005 6:06 pm
by bwv2
Yeah it's too hot here. I live in Flag but am down in PHX for a 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= 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.

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);
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 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);
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 woul 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);
This seems (to me) to be good code. I am, however, not very good at php yet. I look at phpMyAdmin after runnive 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  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(&quote;localhost&quote;, &quote;&quote;, &quote;&quote;);
mysql_select_db(&quote;renewabledb&quote;, $conn);
$sql= &quote;DROP TABLE IF EXISTS windWeibull&quote;;
$result= mysql_query($sql, $conn);
$sql=&quote;CREATE TABLE windWeibull (id INT PRIMARY KEY AUTO_INCREMENT, velocity FLOAT, probability INT);
$result= mysql_query($sql, $conn);
$sql= &quote;INSERT INTO TABLE windWeibull VALUES(NULL, '$windSpeed', '$velProb')&quote;;
$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 lochere. I live in Flag but am down in PHX for a 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= 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(&quote;localhost&quote;, &quote;&quote;, &quote;&quote;);
mysql_select_db(&quote;renewabledb&quote;, $conn);
$sql= &quote;DROP TABLE IF EXISTS windWeibull&quote;;
$result= mysql_query($sql, $conn);
$sql=&quote;CREATE TABLE windWeibull (id INT PRIMARY KEY AUTO_INCREMENT, velocity FLOAT, probability INT);
$result= mysql_query($sql, $conn);
$sql= &quote;INSERT INTO TABLE windWeibull VALUES(NULL, '$windSpeed', '$velProb')&quote;;
$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 or 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);
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 tabllagstaff 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", "", "&quote;);
mysql_select_db(&quote;renewabledb&quote;, $conn);
$sql= &quote;DROP TABLE IF EXISTS windWeibull&quote;;
$result= mysql_query($sql, $conn);
$sql=&quote;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(&quote;localhost&quote;, &quote;&quote;, &quote;&quote;);
mysql_select_db(&quote;renewabledb&quote;, $conn);
$sql= &quote;DROP TABLE IF EXISTS windWeibull&quote;;
$result= mysql_query($sql, $conn);
$sql=&quote;CREATE TABLE windWeibull (id INT PRIMARY KEY AUTO_INCREMENT, velocity FLOAT, probability INT);
$result= mysql_query($sql, $conn);
$sql= &quote;INSERT INTO TABLE windWeibull VALUES(NULL, '$windSpeed', '$velProb')&quote;;
$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. 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);
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.

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);
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;r 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(&quote;renewabledb&quote;, $conn);
$sql= &quote;DROP TABLE IF EXISTS windWeibull&quote;;
$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);
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 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);
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 115to...

Code: Select all

$conn = mysql_connect("localhost", "", "");
mysql_select_db("renewabledb&quote;, $conn);
$sql= &quote;DROP TABLE IF EXISTS windWeibull&quote;;
$result= mysql_query($sql, $conn);
$sql=&quote;CREATE TABLE windWeibull (id INT PRIMARY KEY AUTO_INCREMENT, velocity FLOAT, probability INT);
$result= mysql_query($sql, $conn);
$sql= &quote;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(&quote;localhost&quote;, &quote;&quote;, &quote;&quote;);
mysql_select_db(&quote;renewabledb&quote;, $conn);
$sql= &quote;DROP TABLE IF EXISTS windWeibull&quote;;
$result= mysql_query($sql, $conn);
$sql=&quote;CREATE TABLE windWeibull (id INT PRIMARY KEY AUTO_INCREMENT, velocity FLOAT, probability INT);
$result= mysql_query($sql, $conn);
$sql= &quote;INSERT INTO TABLE windWeibull VALUES(NULL, '$windSpeed', '$velProb')&quote;;
$result= mysql_query($sql, $conn);
Th for a 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= 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 wohit 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);
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'tit 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);
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
$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

Posted: Fri Jul 08, 2005 6:13 pm
by Burrito
I'm in phx too, originally 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());
error reporting to see why it's not working:

Code: Select all

$result = mysql_query("select * from blahblah")
  or die(mysql_error());
2a].

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());
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());
2a]
$result = mysql_query(&quote;select * from blahblah&quote;)
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());
, 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());
hould 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());
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());
ting to see why it's not working:

Code: Select all

$result = mysql_query("select * from blahblah")
  or die(mysql_error());
[/php:1:635227642;quote;)
  or die(mysql_error());
227642a]stand 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());
"select * from blahblah")
or die(mysql_error());

$result = mysql_query("select * from blahblah")
or die(mysql_error());

Posted: Fri Jul 08, 2005 6:21 pm
by bwv2
I'm moving to SLC 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());
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?ELECT * FROM doodad") or die(&quote;Query failure: &quote; . 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());
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, 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());
Anything? Maybe I'm just looking at the whole thing wrong. I keep getting these errors saying:

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());
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?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());
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 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());
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 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());
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 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());
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 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());
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 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());
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? 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());
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.he weak). My error code says...

Code: Select all

$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 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());
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 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());
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?

Posted: Fri Jul 08, 2005 6:26 pm
by Burrito
if the table doesn'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 have

Code: Select all

ini_set('display_errors', 1);
error_reporting(E_ALL);
is 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 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);
[/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 have

Code: Select all

ini_set('display_errors', 1);
error_reporting(E_ALL);
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);
have

Code: Select all

ini_set('display_errors', 1);
error_reporting(E_ALL);
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);
rs 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);
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);
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);
op of your page and remove any error masks you might have

Code: Select all

ini_set('display_errors', 1);
error_reporting(E_ALL);
r_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);
ini_set('display_errors', 1);
error_reporting(E_ALL);

Posted: Fri Jul 08, 2005 10:58 pm
by bwv2
I'm away from my code for now, but I'll try what you said tomorrow. Here are a couple more things that I think could have something to do with it (or at least I'd like to know about them)...

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.