Search:
Type: Posts; User: themonkey40
Search :
Search took 0.01 seconds.
Here is my table structure for the table:
CREATE TABLE `orders` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`po_number` varchar(7) DEFAULT NULL,
`product` varchar(55) DEFAULT NULL,
`date`...
My company is hosting a sales promotion and all the data for each sale is kept in a mysql database. We want to see who the top salesperson is, by counting the number of sales of each participant,...
I am building an online store for my company. Customer are able to buy one of our products from our website where we charge there credit card. We have purchased and installed an SSL cert on the...
Mindzai could you give me an example?
I am trying to write a function that closes the connection created in the following class:
class dbConnect {
function connect($dataB) {...
Mindzai, when I tried your cod, I got the following error.
"Warning: Missing argument 1 for MySqlDatabase::numRows(), called in...
also, is there a way to close the database connection in the dbconnect class after the query is run?
That I am, practicing OOP. I made the $this-> change and it does work. Could you provide an example of what you mean by moving the connection to the constructor and as a seperate method?
Ok so I am trying to create a class that connects to mysql and runs a query. Here is the code:
class dbConnect {
public $host;
public $user;
public $passwd;
public $dataB;
function...
Thanks again criterion9. I used the while statement and it worked.
Hampster, do you have a better piece of code I can use. Basically I can't get the loop to run. I fixed the semicolon (late night mistake).
When I run the script now, I get an error that there is...
I am getting an error from a foreach statement, not sure why, here is the code:
$new_prod_id = $count + 100;
function arrayQuery($f_prod_id,$table)
{
$sql=mysql_query("SELECT * FROM...
$mra_number is the unique key across all my tables. Only one row per $mra number. How do I display the data from:
function shipQuery($mra_num)
{
$mra_num = (int)$mra_num; // force integer...
Oh my gosh, that worked as is simply amazing code. So stoked thanks for everyone's help. webdeveloper.com rocks.
Special thanks to criterion9 for staying with me through my stupidness.
criterion9 I made that change in my HTML form, how to I get the php process page to update all the rows using the function?
Ok I am getting a little lost, but really appreciate everyone's help. Here is some code that may clarify things:
updateSpec($_POST['id1'],$_POST['desc1'],$_POST['value1'],$_POST['num1'])...
What should my form look like?
criterion9 I tried your code, but got the following error message:
Warning: Invalid argument supplied for foreach() in /edit_spec_process.php on line 5
Any ideas why?
I am writing a program where I repeat this code on numerous pages:
$shipping_query=("SELECT * FROM `shipping` WHERE `mra_number`='$mra_number'");
$shipping_result = mysql_query($shipping_query);...
when I use the following code:
$count = 25;
for($i = 1; $i < $count; $i++) {
echo "the var is" . $id[$i] . "<br>";
}
exit();
i get the following output:
would something like this work?
$count = 25
for($adder = 1; $adder < $count; $adder++)
$id[$adder] = $_POST['id[$adder]']; ...
would something like this work?
$count = 25;
for($adder = 1; $adder < $count; $adder++)
$id[$adder] = $_POST['id[$adder]'];
would it then do this 25 times?
here is the form page code:
<tbody>
<?php
$num_adder= 1;
$desc_adder= 1;
$value_adder = 1;
$id_adder = 1;
while($spec=mysql_fetch_array($sql)) { ?>
<tr>
yes Could it also work like this?
$adder = 1;
while($adder <= $count){
$id[$adder]=$_POST['id[$adder]'];
$desc[$adder]=$_POST['desc[$adder]'];
...
Not totally making sense to me. Let me give you more code to explain better.
$adder = 1;
while($adder <= $count)
$id1=$_POST['id1'];
$desc1=$_POST['desc1'];
$value1=$_POST['value1'];...