MySQL
MySQL
MySQL
MySQL
MySQL
MySQL MySQL MySQL MySQL MySQL MySQL MySQL MySQL
MySQL MySQL
MySQL
Go Back  Xtreme Visual Basic Talk > > > MySQL


Reply
 
Thread Tools Display Modes
  #1  
Old 03-30-2014, 02:16 PM
David222 David222 is offline
Junior Contributor
 
Join Date: Jan 2003
Location: Oshawa, ON, Canada
Posts: 299
Unhappy MySQL


Hi All
I have no where else to turn.
I've tried and tried

My code is
Code:
	$sql = mysql_query("UPDATE $donations a
			LEFT OUTER JOIN $members b
			  ON a.Envelope = b.Envelope
			SET a.Error = 'Y'
			WHERE b.Envelope IS Null
			AND SheetIdFK = $id  " );
		$result = mysql_fetch_array($sql);
I keep getting the error...
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean

I know what the error is but why?
I know there is an error in the SQL statement somewhere.

I'm trying to Update the error column in donations if the envelope is not found in the members table
Reply With Quote
  #2  
Old 03-31-2014, 02:29 AM
Flyguy's Avatar
FlyguyMySQL Flyguy is offline
Lost Soul

Super Moderator
* Guru *
 
Join Date: May 2001
Location: Vorlon
Posts: 19,165
Default

To start I don't have any knowledge of PHP

But I don't understand what you are doing in your query

You have a JOIN in your update query on *.Envelope and you want to update the rows which have *.Envelope is NULL.
What are SheetIdFK and $id?
Do you really have a table name $donations?
Or are the $ variables?
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
MySQL
MySQL
MySQL MySQL
MySQL
MySQL
MySQL MySQL MySQL MySQL MySQL MySQL MySQL
MySQL
MySQL
 
MySQL
MySQL
 
-->