Re: Error Question!

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Matthew,

It seems, from looking at your supplied code, that you have a variable-naming typographic error.
The variables have to match:
$projects_results = mysql_query($projects, $conn) or die(mysql_error());
$project_data = mysql_fetch_array($project_results)) 

--
Jeff White is: 
bitslayer@xxxxxxxxxxx 


-------------- Original message -------------- 
From: Matthew Gonzales <matt323@xxxxxxx> 

> Hello Everyone, 
> 
> I keep getting this error: *Warning*: mysql_fetch_array(): supplied 
> argument is not a valid MySQL result resource in 
> *C:\wamp\www\login\testroom\upload.php* on line *107, *for this 
> particular area of code. 
> 
> 
> Code: 
> 
> //Check to see what files they have uploaded in the past 
> $projects = "select name, type, location, date_added from uploads 
> where user_id = '" . $_SESSION['user_id'] . "' "; 
> $projects_results = mysql_query($projects, $conn) or die(mysql_error()); 
> 
> //Create table for projects 
> $display_block = '
> 
> Project Name
> Project Type
> View Project
> Project Created
> 
'; 
> 
> //Extract data to table 
> while ($project_data = mysql_fetch_array($project_results)) * Error 
> occurs here!* 
> { 
> $project_name = $project_data['name']; 
> $project_type = $project_data['type']; 
> $project_link = $project_data['loction']; 
> $project_date = $project_data['fmt_date_added']; 
> 
> //insert project data 
> $display_block .=' 
> 
> ' . $project_name . 
> '
> ' . $project_type . 
> '
> View
> class="heading">' . $project_date . 
> '
> 
'; 
> } 
> 
> //Close display block 
> $display_block .=''; 
> 
> Does anyone have any idea what is going on. I have used a similar code 
> liek this before and it worked. I can output the mysql string to the 
> browser and then copy and paste it to PHPmyadmin and do an sql query and 
> it comes back with the correct results. I don't know what is up. 
> 
> Thanks! 
> 
> Matt G 
> 
> ** 
> -- 
> Matthew Gonzales 
> IT Professional Specialist 
> Enterprise Information Technology Services 
> University of Georgia 
> Email: matt323@xxxxxxx 
> Phone: (706)542-9538 
> 
> -- 
> PHP Windows Mailing List (http://www.php.net/) 
> To unsubscribe, visit: http://www.php.net/unsub.php 
> 

[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux