FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Manually create array that matches mysql_fetch_array
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Manually create array that matches mysql_fetch_array [message #179732 is a reply to message #179729] Thu, 29 November 2012 14:24 Go to previous messageGo to previous message
Peter H. Coffin is currently offline  Peter H. Coffin
Messages: 245
Registered: September 2010
Karma:
Senior Member
On Thu, 29 Nov 2012 00:51:04 -0800 (PST), Jason C wrote:

> In my script, I'm potentially creating information to insert in
> to MySQL (based on a few variables), then later in the script I'm
> SELECTing the same data back out of MySQL. Like this:

Stop a moment, back up, and start by describing what you want to
ACCOMPLISH, not what you want to do. Because it sounds like you have
Some Data (A + B), some of which (may) exist in a database (B + U), and
you want to have access to the most current of all of it (A + B + U)
efficiently. If that's the case, then it's not really redundant at all;
REPLACE INTO... (or, depending on your design, INSERT ... ON DUPLICATE
.... ) is the proper path, because something else could change part of
the data you thought "correct" between the time that you do the insert
and the time you get to pulling your result set (which should be right
before you want to use it).

--
23. I will keep a special cache of low-tech weapons and train my troops
in their use. That way--even if the heroes manage to neutralize my
standard-issue energy weapons useless--my troops will not be overrun
by a handful of savages armed with spears.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Query a Array Field in MySQL
Next Topic: Experience Web and Smartphone designer required
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Thu Nov 28 11:43:22 GMT 2024

Total time taken to generate the page: 0.04167 seconds