![](https://forums.phpfreaks.com/uploads/set_resources_1/84c1e40ea0e759e3f1505eb1788ddf3c_pattern.png)
Canman2005
-
Posts
669 -
Joined
-
Last visited
Never
Posts posted by Canman2005
-
-
Hi all
I have a HTML form which has the following fields
<input id="txtRow1" name="txtRow1" type="text"> <input id="txtRow2" name="txtRow2" type="text"> <input id="txtRow3" name="txtRow3" type="text"> <input id="txtRow4" name="txtRow4" type="text">
as you can see, the name of the field is "txtRow" followed by a number
some of my pages have just 2 of the above fields and some pages have up to 45 (so going from "txtRow1" to "txtRow45").
When the form is submitted, I want to run a query for each textfield that exists.
I was going to initally do
if($_POST['txtRow1'] != '') { } if($_POST['txtRow2'] != '') { } if($_POST['txtRow3'] != '') { }
and so on, but I think that might make my page really long and going forward some pages could have up to 120 of these textfields.
Is there an easy way to do this?
Hope I make some kind of sense
thanks in advance everyone
dave
-
Hi all
I found this super cool script
http://www.mredkj.com/tutorials/tableaddrow.html
instead of a button called "add" I have replaced it with
<select name="" onChange="addRowToTable();"> <option value="111">111</option> <option value="222">222</option> <option value="333">333</option> </select>
so that when you select something from the menu, it inserts a new row for you.
My question is.
How can I carry the value from the menu to the new row?
So for example, if I selected the menu item "222", it would carry over and insert "222" into the new row added.
Is that possible and if so, can anyone help please?
Thanks in advance
Dave
-
It's ok, im going to use a javascript to select all the items in the List/Menu when the submit button is clicked
-
but I don't know what values are being passed over from one List to another, therefore doing
$array=array("Dolor","Donec","Integer","Lacus","Leo");
would not be possible unless I knew what values the user was going to pass from one to another
-
the problem is im unable to do
$array=array("Dolor","Donec","Integer","Lacus","Leo");
simply because the values in "users1[]" are dynamically added from another List/Menu, its basically javascript passing over the values from one list to another.
-
If I try and submit the form without any being selected, I get
Warning: Invalid argument supplied for foreach()
whereas I want it to ignore the fact none are selected and just carry through all the values from the List/Menu even the ones which are not selected.
-
Hi all
I have a List/Menu which looks lik
<select name="users1[]" id="users1[]" multiple="multiple"> <option value="Dolor">Dolor</option> <option value="Donec">Donec</option> <option value="Integer">Integer</option> <option value="Lacus">Lacus</option> <option value="Leo">Leo</option </select>
Is it possible to use
foreach($_POST['users1'] as $d)
on all items in the List/Menu, despite if they have been selected or not?
thanks in advance
ed
-
thanks man
-
I guess just adding
AND date LIKE '%$year%'
to the end of the query and year being defined as
$year = date('Y');
will be good enough
-
thanks
-
Thanks
Tried that, but returned nothing
I have a row which has a date of 23/08/2009 which is todays date, but the query didnt seem to pick it up
Any ideas anyone?
thanks again
-
Hi all
I have a database table that has a field called `date`, the field is in the format YYYY-MM-DD
How could I write a query which would select all rows happening this week, so if today was a Tues, it would grab
Tues, Wed, Thurs, Fri, Sat, Sun
and if it was a Fri it would grab
Fri, Sat, Sun
Thanks very much everyone
Dave
-
thanks guys, ill do some work on the query script
-
The code is
$sql = "SELECT * FROM `users` WHERE `live` = '0' ORDER BY `fname` ASC"; $show = @mysql_query($sql, $connection) or die(mysql_error()); while ($row = mysql_fetch_array($show)) { }
There is around 1,800 records and I load that much data on one page as I need it for a report im doing.
Do you think its just overloading the server?
I was simply doing a LIMIT to see if I could find the point at where there is an issue and then I may have been able to nail it down to a particular record in the database
-
Hi all
I have something wierd happening.
I have a standard QUERY
SELECT * FROM `users` WHERE `live` = '0' ORDER BY `fname` ASC
but this seems to cause my page an Internal Server Error
If I adjust that QUERY to
SELECT * FROM `users` WHERE `live` = '0' ORDER BY `fname` ASC LIMIT 980
then it runs the page fine and no Internal Server Error
DOes anyone know why this might be happening?
THanks in advance
Dave
-
Hi
Sorry, I know this is most likely in the wrong forum group, but im not sure if any freelancers are looking in the freelancer job forum board.
I'm in urgent need of a good php freelancer who can do work this weekend to help sort out a drupal shopping cart.
If you can, please let me know on this message or PM me
And sorry again if this is in the wrong group, I just don't think many people look at the freelancer group
thanks
-
we need a coder this weekend, please email me
mark.stuart@intelligentbean.com
thanks
-
-
Hi all
I have a bunch of records which have a date field `datecreated` next to each one, so for example
2003-09-28
these are dates that products are built (manufactor)
I want to do a QUERY which would grab all records that the date of manufactor was between x and y years.
So grab all records which have a manufactor date of between 10 and 15 years old
Is that possible or should I store the date next to each item?
Thanks so much everyone
Dave
-
We still need someone, please contact me
-
anyone???
-
Hi
Does anyone have any experience with the UPS module in Drupal?
Suffering problems.
Thanks
-
I still need someone, please msn me
-
Hi
Please get in touch with me if you know javascript and have dealt with Drupal, Ubercart and the UPS Module
You must be availble today
MSN me: markystuart@hotmail.com
Thanks
[SOLVED] PHP Question
in PHP Coding Help
Posted
pure genius AlexWD, spot on mate