PHP Batch Process? Is this Possible?
Moderator: General Moderators
Re: PHP Batch Process? Is this Possible?
Hi there.
I can understand your thoughts and feelings regards this but as coders, they will not want to develop a system that is slightly backwards thinking in relation to how they code. It is called 'standards' and that is what the PHP language is fundamentally based around.
I wish you luck in your thoughts about your system and I hope you get what you want in the end. However, you will run into problems as we all extend our systems as inevitably our needs or desires find something else that could help us.
Best wishes.
I can understand your thoughts and feelings regards this but as coders, they will not want to develop a system that is slightly backwards thinking in relation to how they code. It is called 'standards' and that is what the PHP language is fundamentally based around.
I wish you luck in your thoughts about your system and I hope you get what you want in the end. However, you will run into problems as we all extend our systems as inevitably our needs or desires find something else that could help us.
Best wishes.
Re: PHP Batch Process? Is this Possible?
that being said. i can do most of it, i just don't know how to take information out of my database and have it ran through a processing page separately.
Re: PHP Batch Process? Is this Possible?
i don't know where it came off as backwards by just explaining what i needed done. thanks for your input!
and thanks for helping out the new guy! I'm sure you didn't learn everything without some help! i only know very little and i wuldnt know any of it if it weren't for people like celauran that actually help people instead of talk down to them like your some php god or something. i am a young kid and this is what i chose to do my summer instead of drink and smoke cigarettes with the "Cool kids"
and thanks for helping out the new guy! I'm sure you didn't learn everything without some help! i only know very little and i wuldnt know any of it if it weren't for people like celauran that actually help people instead of talk down to them like your some php god or something. i am a young kid and this is what i chose to do my summer instead of drink and smoke cigarettes with the "Cool kids"
Re: PHP Batch Process? Is this Possible?
Hi there.
Look into the 'select' statement for extracting information from a database and also 'loops' such as, 'for' and 'foreach'. You have a number of choices about how you want to store the information while it is being ran through another script. The information will be stored as an array from the database and the 'loop' will allow you to extract that information from the array into separate string variables to use as and when you please.
Best wishes.
Look into the 'select' statement for extracting information from a database and also 'loops' such as, 'for' and 'foreach'. You have a number of choices about how you want to store the information while it is being ran through another script. The information will be stored as an array from the database and the 'loop' will allow you to extract that information from the array into separate string variables to use as and when you please.
Best wishes.
Re: PHP Batch Process? Is this Possible?
i hope somebody can still help me though, i liked this forum and was learning a lot here.
Re: PHP Batch Process? Is this Possible?
Here's the thing; you keep talking about running these orders through different 'scripts' but never actually explain what they do or what the differences between them are. I've been trying to help you come up with a process to automate this, to do exactly what you're describing, but as long as 'script' remains some black box there's little more I can do.
Re: PHP Batch Process? Is this Possible?
its not possible to just use them the way they are? and just pass the data to them as if it were just me entering the information into a form?
Re: PHP Batch Process? Is this Possible?
They're separate pages that rely on POST data? Sure, that can be automated but you'd need to use cURL or something to send the POST data and that's messy and probably more work than just fixing the workflow into something more reasonable.
Re: PHP Batch Process? Is this Possible?
i can fix the work flow myself but i wanted to have a page that shows all form data and then i can pick and chose when and which ones i want to be ran through the script. i don't want them all ran through it. i want to be able to pick and chose which ones are ran through it.
Re: PHP Batch Process? Is this Possible?
Yes, that's been clear from the beginning. That's not a problem.
Re: PHP Batch Process? Is this Possible?
i didnt think it was going to require so much work and changing around. i thought there was something small that can be put together that takes info from a database and runs it through to a page as if it were a form sending data to it. and do it automatically for each row that i select to go through.
Re: PHP Batch Process? Is this Possible?
Celauran wrote:They're separate pages that rely on POST data? Sure, that can be automated but you'd need to use cURL or something to send the POST data and that's messy and probably more work than just fixing the workflow into something more reasonable.
yes they rely on post data now because they're made for forms
i will change all the variables to get data from an array instead
i am going to come into the page with a multidimensional array that will look like this
Code: Select all
<?php
$processthese = array(
array("ordernumber","formnumber","info1","info2","info3","info4","type"),
array("ordernumber","formnumber","info1","info2","info3","info4","type"),
array("ordernumber","formnumber","info1","info2","info3","info4","type"),
);
?>
Re: PHP Batch Process? Is this Possible?
Then it would just be as simple as
Code: Select all
<?php
foreach ($processthese as $order) {
// do something here
// reference $order instead of $_POST
}Re: PHP Batch Process? Is this Possible?
ok thanks a lot.
i am trying to set up my multi dimensional array.
i will have my view orders page where i select orders i want to process.
it'll bring it to the next page which will create a multidimensional array
right now i am testing a bunch of stuff and for some reason i have 4 things in my array and the foreach i made that pulls data into arrays only does 3 of them.
i manually wrote in the ordernumbers and formnumbers and they do exist in the database. i know this is not creating a multidimensional array but just a single array, i was testing stuff as i learn.
any idea why i am only getting 3 results? i double checked 100 times and i am calling for the right order and form numbers?
thanks a lot
i am trying to set up my multi dimensional array.
i will have my view orders page where i select orders i want to process.
it'll bring it to the next page which will create a multidimensional array
right now i am testing a bunch of stuff and for some reason i have 4 things in my array and the foreach i made that pulls data into arrays only does 3 of them.
Code: Select all
<?
error_reporting(E_ALL);
$selected = array( "PH62W8" => "8482",
"PH62W8" => "7437",
"FRF856" => "5207",
"62R9PK" => "4696"
);
include 'dblogin.php';
foreach ($selected as $ordernumber => $formnumber) {
$query = "SELECT * FROM `rawdata` WHERE `ordernumber` = '$ordernumber' AND `formnumber` = '$formnumber'";
$result = mysql_query($query) or die(mysql_error());
while($row = mysql_fetch_array($result)){
$clientarray = array( "ordernumber" => $row['ordernumber'],
"formnumber" => $row['formnumber'],
"info1" => $row['info1'],
"info2" => $row['info2'],
"info3" => $row['info3'],
"info4" => $row['info4'],
"type" => $row['type']);
}
echo "Check box test<pre>" ;
print_r($clientarray);
echo "</pre>";
}
?>
i manually wrote in the ordernumbers and formnumbers and they do exist in the database. i know this is not creating a multidimensional array but just a single array, i was testing stuff as i learn.
any idea why i am only getting 3 results? i double checked 100 times and i am calling for the right order and form numbers?
thanks a lot
Re: PHP Batch Process? Is this Possible?
i added 7 to the array and it only prints 4?
i don't know if its a coincidence but it only prints 1 for each order number, like 1 order number has 3 formnumbers . its only doing 1 formnumber for each ordernumber. i don't know if this is just a coincidence though.
edit. its no coincidence that is the problem. only doing 1 formnumber for each ordernumber
i don't know if its a coincidence but it only prints 1 for each order number, like 1 order number has 3 formnumbers . its only doing 1 formnumber for each ordernumber. i don't know if this is just a coincidence though.
edit. its no coincidence that is the problem. only doing 1 formnumber for each ordernumber
Last edited by donny on Thu Sep 04, 2014 10:30 am, edited 1 time in total.