Sponsored Content
Top Forums Programming C Beginner Looking For Suggestions Post 302302661 by deckard on Tuesday 31st of March 2009 03:12:00 PM
Old 03-31-2009
Quote:
Originally Posted by c_d
parallel in what sense?
When I've seen him do PHP queries against a MySQL DB, he doesn't just do a single query. He'll usually pull in multiple bits of information even though to me it doesn't seem relevant. But afterwards in his PHP script, the data returned from the queries is used in groups. Kind of hard to explain I guess. It's just that my thinking would be:

Execute a query and pull in one column of data
Process the data
Execute another query for another column
Process that data
etc...
Then take all the data stored in arrays and format it for display

Whereas his thinking seems to be

Execute a query to pull in all needed data from multiple tables
Process in one function and format for display

I guess maybe it just takes having a lot of familiarity with the language and you start to see the quicker way of doing things. His approaches also seem to be able to avoid the spaghetti logic I get myself into sometimes by nature of their compactness.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Suggestions on where to begin?

I have been a student at Hendrix Institute for about a year now. My term is comming to an end by the end of december. I have learned varios computer programs for web development that include Flash 5 and Dreamweaver. Actionscripting, Javascript and Database development with Access was all... (4 Replies)
Discussion started by: andrew25008
4 Replies

2. UNIX for Dummies Questions & Answers

Suggestions wanted ...

All, Have an AMD-K6/2 PC, 20G.Hd along with RH7.2. Wanting to know what I should do in terms of setup (workstation/server) and then what I can do with it? I'd like to learn a DBMS and SQL - can I do this using RedHat? Any suggestions with how I can use/ what I can do with this appreciated. (3 Replies)
Discussion started by: Cameron
3 Replies

3. UNIX for Dummies Questions & Answers

Backup suggestions

The current backup procedure we using a tar command in linux. The files are stored in one partition in different folders. The docs stores in day wise folders like ex: /usr/data/xyz/20050129, /usr/data/xyz/20050130 .............etc We using tar & gzip command to take backup everyday. The backup... (3 Replies)
Discussion started by: bache_gowda
3 Replies

4. UNIX for Advanced & Expert Users

Looking for Suggestions...

We run WebSphere and by default it wants to install everything under /usr. While I can understand the default (everyone has a /usr) I would like to move this over to a dedicated volume group called apps and then setup my lv's and fs's here. Our WebSphere Admin doesn't like this because apparently... (1 Reply)
Discussion started by: scottsl
1 Replies

5. Solaris

Suggestions Req

Hi all, I have worked on HP UNIX and now i have moved to SunSolaris which i never used to work. I am more on programming side like shell and perl scripting. So i want to know from you experts that i need to take care or changes which i code in sun solaris in compared to HP unix. Suggestions... (1 Reply)
Discussion started by: ravi.sadani19
1 Replies

6. Shell Programming and Scripting

Suggestions on input

Hi, I have written a script which calls a process which ends up in a reboot of the system. At the end of the reboot it prompts for login & i need to provide the login details. am not able to figure out hw to do this. Doubt: will echoing login details after calling the process work? for ex:... (1 Reply)
Discussion started by: meera
1 Replies

7. UNIX for Advanced & Expert Users

Need suggestions.......

Hello there....i am a final year comp science student.......i am thinking of doing my project on unix platform......which one do u suggest?thanx in advance... (3 Replies)
Discussion started by: theprasad1990
3 Replies

8. Solaris

Suggestions for new T5140

I've been busy and fell behind on Sun/Oracle. Forgive me if too basic. I welcome brief, cryptic, or advanced replies. I also welcome noobie information since I may have no clue what's up at the moment. Problem statement: I inherited a computer to set up. I would rather not figure out 8 months... (1 Reply)
Discussion started by: Nevyn
1 Replies

9. UNIX for Dummies Questions & Answers

Suggestions for the interview

Hi guys, i'm undergoing a traning in solaris administration and i request if any one have an idea on the interview questions on solaris. thank you. (3 Replies)
Discussion started by: 038karthik
3 Replies

10. Shell Programming and Scripting

Suggestions on this script please

i=1 out="" j=`expr 2 * $1` while do out="$out"#"" echo $out ((i=i+1)) done while do print ${out%?} ((i=i+1)) done This script is throwing an error: gurnish:/home/fnb/gurnish/saurabh/scripts> while1 3 expr: 0402-050 Syntax error. # (6 Replies)
Discussion started by: targetshell
6 Replies
MYSQL_INSERT_ID(3)							 1							MYSQL_INSERT_ID(3)

mysql_insert_id - Get the ID generated in the last query

SYNOPSIS
Warning This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQL extension should be used. See also MySQL: choosing an API guide and related FAQ for more information. Alternatives to this function include: omysqli_insert_id(3) o PDO::lastInsertId int mysql_insert_id ([resource $link_identifier = NULL]) DESCRIPTION
Retrieves the ID generated for an AUTO_INCREMENT column by the previous query (usually INSERT). o $ link_identifier -The MySQL connection. If the link identifier is not specified, the last link opened by mysql_connect(3) is assumed. If no such link is found, it will try to create one as if mysql_connect(3) was called with no arguments. If no connection is found or established, an E_WARNING level error is generated. The ID generated for an AUTO_INCREMENT column by the previous query on success, 0 if the previous query does not generate an AUTO_INCRE- MENT value, or FALSE if no MySQL connection was established. Example #1 mysql_insert_id(3) example <?php $link = mysql_connect('localhost', 'mysql_user', 'mysql_password'); if (!$link) { die('Could not connect: ' . mysql_error()); } mysql_select_db('mydb'); mysql_query("INSERT INTO mytable (product) values ('kossu')"); printf("Last inserted record has id %d ", mysql_insert_id()); ?> Caution mysql_insert_id(3) will convert the return type of the native MySQL C API function mysql_insert_id() to a type of long (named int in PHP). If your AUTO_INCREMENT column has a column type of BIGINT (64 bits) the conversion may result in an incorrect value. Instead, use the internal MySQL SQL function LAST_INSERT_ID() in an SQL query. For more information about PHP's maximum integer values, please see the integer documentation. Note Because mysql_insert_id(3) acts on the last performed query, be sure to call mysql_insert_id(3) immediately after the query that generates the value. Note The value of the MySQL SQL function LAST_INSERT_ID() always contains the most recently generated AUTO_INCREMENT value, and is not reset between queries. mysql_query(3), mysql_info(3). PHP Documentation Group MYSQL_INSERT_ID(3)
All times are GMT -4. The time now is 09:09 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy