Hi... I'm working on an email program and I'm getting quite confused with this error I keep getting: "Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource"... Here is the questionable part of my code:
<?php
$access = mysql_connect(host,root,toor);
$select = mysql_select_db("db",$access);
$query = "INSERT INTO db '$id'";
$result = mysql_query($query,$access);
if ($id >= '4') {
$query2 = "ALTER TABLE db DELETE COLUMN id
&& ADD id SMALLINT NOT NULL AUTO_INCREMENT,
ADD PRIMARY KEY (id)";
$result2 = mysql_query($query2,$access);
} else {
$query3 = "SELECT * FROM db WHERE ($id == MAX('$id')";
$result3 = mysql_query($query3,$access);
while ($r = mysql_fetch_array($result3)) {
extract($r);
I can't seem to figure out what's wrong with that code... Any suggestions? Oh yeah - my e-mail question: for the "to" portion in the mail command if you extract results from an array could I perhaps use $to = "$email"; if I was storing the email address/es in the database?