I want to know how do I read in oracle sql query statements from an array and execute them using php?
Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › Web Coding › sql and php help
Featured Sponsors
Recent Reviews
-
Price reviewed: £16 After reviewing the Anker 8000DPI Gaming mouse - I was intrigued how the 2000DPI one compared. Here is my review for the 8K DPI one:...
-
£10, 2000 DPI, excellent design, elegant and a tiny USB for connectivity. What else could you ask for? This mouse is brilliant in all aspects! Really love using it as a on-the-go mouse! The USB...
-
This is my "quick review", I'll go more in-depth soon... Been running this kit for some time, having originally purchased it in late March/early April of 2012. When I bought it, I expected a kit...
-
This is a very nice and fast CPU... I see various reports on temperature, but mine runs cool at 4.5 GHz and rock solid doing BOINC tasks 24/7. Nothing but good things to say about this processor. I...
-
Story : You play as the legendary beast hunter Van Helsing trying to hunt monsters, help the innocent civilians and hunt down the menace upon Borgovia. Graphics : As a game similar...
sql and php help
This is what I got.
Concerns:
is my array and for loop implemented correctly?
should commit be inside the for loop or can I commit after all the queries are executed?
should I add break statement to break out of the for loop if cursor and result failed since it will close the connection anyway?
Concerns:
is my array and for loop implemented correctly?
should commit be inside the for loop or can I commit after all the queries are executed?
should I add break statement to break out of the for loop if cursor and result failed since it will close the connection anyway?
Code:
function execute_sql_in_oracleMulti($sqlArray) {
putenv("ORACLE_HOME=/home/oracle/OraHome1");
putenv("ORACLE_SID=orcl");
$connection = oci_connect ("test", "test");
if($connection == false){
// failed to connect
display_oracle_error_message(null);
die("Failed to connect");
}
// Loop through sql queries array and execute them
for ($i = 0; $i < sizeof(sqlArray); $i++) {
$cursor = oci_parse($connection, $sqlArray[$i]);
if ($cursor == false) {
display_oracle_error_message($connection);
oci_close ($connection);
// sql failed
die("SQL Parsing Failed");
}
$result = oci_execute($cursor);
if ($result == false) {
display_oracle_error_message($cursor);
oci_close ($connection);
// sql failed
die("SQL execution Failed");
}
}
// commit the result
//oci_commit ($connection);
// close the connection with oracle
oci_close ($connection);
$return_array["flag"] = $result;
$return_array["cursor"] = $cursor;
return $return_array;
}
HP DV5T-1000
(13 items) |
| CPU | Graphics | RAM | Hard Drive |
|---|---|---|---|
| Intel Core 2 Duo P7350 | Nvidia Geforce 9600M GT 512MB | G.Skill 2X2GB DDR2 800Mhz | 250GB Samsung SSD 840 Series |
| Optical Drive | OS | ||
| DVD Drive | Windows 8 Pro x64 | ||
| View all | |||
HP DV5T-1000
(13 items) |
| CPU | Graphics | RAM | Hard Drive |
|---|---|---|---|
| Intel Core 2 Duo P7350 | Nvidia Geforce 9600M GT 512MB | G.Skill 2X2GB DDR2 800Mhz | 250GB Samsung SSD 840 Series |
| Optical Drive | OS | ||
| DVD Drive | Windows 8 Pro x64 | ||
| View all | |||
Return Home
Back to Forum: Web Coding
- sql and php help
Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › Web Coding › sql and php help
Currently, there are 1865 Active Users
(673 Members and 1192 Guests)
Recent Discussions
- › So how many OCNers are buying the PS4? 15 seconds ago
- › Best Bang For Buck Socket 1155 CPU 29 seconds ago
- › [Various] Microsoft to backtrack on Xbox One games DRM and "always... 29 seconds ago
- › [BF3] The OCN Active Platoon's Weekly Event Thread. 39 seconds ago
- › Skyrim Artifacts 40 seconds ago
- › [OFFICIAL] GTX 770 Owners Club 55 seconds ago
- › [Joystiq]Microsoft's cloud computing 'vision' for Xbox One remains... 1 minute ago
- › [Official] BitCoin LiteCoin DigitalCoin And all crypto currencies... 1 minute ago
- › Which sound card for Sennheiser PC 360 1 minute ago
- › Girl needs a bit of help from you pros here :) 2 minutes ago
View: New Posts | All Discussions
Recent Reviews
- › Anker Laser Gaming Mouse with 2000DPI, 7 Programmable Button, 5... by Totally Dubbed
- › Anker Wireless Mouse, 3 Adjustable DPI Levels, 2000 DPI, 6 Buttons,... by Totally Dubbed
- › 16GB G.Skill DDR3 PC3-17000 RipjawsZ Series for Intel X79... by nleksan
- › Intel Core i5-3570K 3.4GHz LGA1155 by Tex1954
- › The Incredible Adventures of Van Helsing by iARDAs
- › Skyworth 39E780U UHD tv by maarten12100
- › S.T.R.I.K.E. 7 Gaming Keyboard for PC by hatlesschimp
- › Corsair Obsidian 350D by Oliver1234
- › CrossOver BLACK TUNE 2735AMG IPS LED by RSMJR87
- › Samsung 840 PRO Series MZ-7PD256 256GB 2.5-inch SSD by Drpillz624
View: More Reviews
New Articles
- › ASUS ROG Poseidon by Amar
- › ASUS Transformer Book Trio : a weird Combination by Amar
- › FreeBSD HTPC and Home Server by CaptainBlame
- › Can AMD hardware in New Consoles leverage... by Amar
- › The Future of PC Gaming .. by dava4444
- › GTX 780 Overclocking! by Amar
- › METRO 2033 STARTUP CRASH FIX WORKS by xiangelo
- › Why are DNS Servers Important? How to make... by exzacklyright
- › Titanium Backup Guide For Newbies by exzacklyright
- › How to install ADB (Android Debug Bridge) by exzacklyright
View: New Articles | All Articles
Home | Reviews | Forums | Articles | My Profile
About Overclock.net | Join the Community | Advertise | Contact Us | All Staff
© 2013 Shogun Interactive Development Overclock.net is powered by Huddler Tech | FAQ | Support | Privacy | ToS | DMCA | Site Map
About Overclock.net | Join the Community | Advertise | Contact Us | All Staff
© 2013 Shogun Interactive Development Overclock.net is powered by Huddler Tech | FAQ | Support | Privacy | ToS | DMCA | Site Map




