Mario,
The one neat thing about PHP is when something goes wrong with the code, it
usually tells you where the error is happening and like a small reason why.
On line 11 of your code, you have:
$PHP_SELF,
this is the variable that needs to be defined as to what this string is
supposed to be.
PHP is
Mihail, thanx for your advice, I've got it going now ! :) Thank you !
Richard, your points were valid, the HTML code with the slashes was just a
copy n' paste from a PHP script and the comma I think I deleted by accident
so its all sorted now.
Thank you again!
Graeme :)
- Original Message
Why not use the for loop to post the values?
for ($i=0; $i<$num_rows, $i++) {
if ($i==0) {
bla bla
}
else {
bla2 bla2
}
}
$i=0 ensures that the first record of his query is retrieved.
On Fri, 25 Oct 2002, Hutchins, Richard wrote:
> What about wrapping your logic in a counter? Set $count=1,
> if($
I'm sure there are a hundred ways
$rs = 0; // record set array
for ($i = 0; $i < count($rs); ) {
while($rs = mysql_fetch_array($result)) {
if ($i ==0 ) {
//do first thing
} else {
//do other things
}
$i++
}
Jeff
What about wrapping your logic in a counter? Set $count=1,
if($count=1){do_this; then $count++;} else{do_that}. Wouldn't really add any
overhead to your script since the counter only gets incremented once when
the if() statement is true then stays at 2 and executes the else{} stuff
after that.
Pre
$x = 1;
while($row = mysql_fetch_array($result)) {
if ($x) {
do_something();
$x = 0;
continue;
} else {
do_something_else();
}
}
This sets $x = 1 before the loop. The first time it goes through the loop
it does something for the first record and sets $x
on 10/25/02 2:53 PM, Aaron Wolski at [EMAIL PROTECTED] appended the
following bits to my mbox:
> Basically I need to pull some records out of a database and for the
> first record do_this logic and for each record after in the array
> do_something_else logic.
Psuedo code:
$first_record = 'yes';
Hey guys,
Not really off topic as this involves some Db work as I have to query
the DB.
Got a logic problem that was jumped dumped on me from UPS (dummys!).
Basically I need to pull some records out of a database and for the
first record do_this logic and for each record after in the array
do_s
In addition to what Mihail had to say, I saw a couple of minor things as
well. I'm not sure if they're the cause of or solution to the problem you're
experiencing.
First, I'm pretty sure that a value of value=\"Y\" is not valid HTML. I
don't know what it does to your name/value pair when you POST
Graeme,
first, extend the for loop over the "if" and the query for insertion of
data. As you have it now, it just inserts the last element of the array.
second, I think that the for loop should be $a<$number. if you put <=,
then the loop is processing the array with the last value not assigned by
Hi all, I'm having a problem inserting a value from a checkbox into a MySQL DB. I can
print out what the variable holds, the problem is it just won't go into the DB. Weird
thing is when I login to SSH there isn't a NULL value for it instead that field is
just blank.
Anyone got any ideas what
First time playing with PHP, Apache, and MySQL. I have a simple form error
and I don't know how to solve it. I was doing the Webmonkey PHP/MySQL
tutorial and when I started using forms with $PHP_SELF I started getting
errors with variables not defined.
PHP 4.2.3
MySQL 4.0 Windows 2000
Apache 1.3
What's the error?
-Original Message-
From: Steve Dodkins [mailto:Steve.Dodkins@;ebm-ziehl.co.uk]
Sent: 25 October 2002 16:46
To: Php-Db (E-mail)
Subject: [PHP-DB] select statement
Hi
I get an error message with the following statement, if I remove the 'AND
works_order_part_no=parts_pa
Hi
I get an error message with the following statement, if I remove the 'AND
works_order_part_no=parts_parts_no' I don't get an error message but also
get the wrong data ??
$link = mysql_connect($host, $user, $pass);
mysql_select_db("DB_EDMsystem", $link);
$result = mysql_query("SELECT * FRO
Great, thanks a bunch!
-Original Message-
From: [EMAIL PROTECTED] [mailto:Jeffrey_N_Dyke@;Keane.com]
Sent: Friday, October 25, 2002 3:11 PM
To: Axel
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] PHP and MS-SQL
yes this works. if your code is going to remian on Unix you'll have to
install
Thanks John!
Say, are there any arguments not to use MS-SQL?
Did you run into any problems?
Thanks,
Axel
-Original Message-
From: Negretti, John (CCI-San Diego) [mailto:John.Negretti@;cox.com]
Sent: Friday, October 25, 2002 3:14 PM
To: Axel; [EMAIL PROTECTED]
Subject: RE: [PHP-DB] PHP and
Axel,
Well, I'm not sure what everyone will tell you, but this is what I did. I
used "MyODBC" (on windows) to connect to SQL Server using the built-in "odbc_***()"
PHP functions. There is also the matter of changing your SQL Statements to be
compatible with SQL Server. MySQL and SQL
yes this works. if your code is going to remian on Unix you'll have to
install freetds (www.freetds.org). there are instructions on
www.php.net/mssql for install in the comments...
when you get to the site(freetds.org) I know it says Sysbase..but it is
what you're looking for.
hope this hel
I want to apologize for my ignorance in advance...
I'm developing PHP code with MySQL on Unix platforms for quite a while. Now
I'm asked to use my unix based PHP code with a MS-SQL database on a
Microsoft platform. So while having the php code on a unix platform the
MS-SQL database is obviously sit
You can also do something like this:
if ($db_link = mysql_pconnect($host, $user, $pass)) {
if (mysql_select_db($db,$db_link)) { return $db_link; }
else die("MySQL Error: Cannot select {$db} database using {$user}@{$host}:
".mysql_error());
} else die("MySQL Error: Cannot connect to {$db}:
Hello, friends.
I am working with PHP+ORACLE project. I need there to request a procedure
with pl/sql table parameter.
e.g. something like:
TYPE tbl IS TABLE OF NUMBER INDEX BY BINARY_INTEGER;
I had found OCINewCollection() function in manual. Unfrortunatly this
function description is only "com
We faced this problem, and decided if we couldn't get a good solution to
eliminate the printer. Turns out the users liked it better, and we
eliminated a lot of paper.
- First we wrote a report writer.
- All reports go to the database.
- We wrote a report file system.
- The report output title sho
Go to www.mysql.com and join their's general list. it's address is
[EMAIL PROTECTED]
Andrey
- Original Message -
From: "Steve Vernon" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, October 25, 2002 2:15 PM
Subject: Re: [PHP-DB] Millions of records in MySQL
> Which is the MyS
yes i did, and it creates a the access.temp2.txt file but it only contains
the last array...
- Original Message -
From: "Jason Wong" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, October 25, 2002 6:40 PM
Subject: Re: [PHP-DB] Fw: array transfer via form.
> On Friday 25 Octobe
Which is the MySQL list you are talking about please?
Thanks,
Steve
> On Friday 25 October 2002 16:10, Steve Vernon wrote:
> > Hiya,
> > I remember ages ago that mysql does not properly handle upwards of
10
> > million records in a table?
> >
> > Any details would be great!
>
> Try it, o
> I remember ages ago that mysql does not properly handle upwards of 10
> million records in a table?
What's this got to do with PHP?
And yes, MySQL will handle it, depending on what you're doing with the data.
There are always alternatives, though.
---John Holmes...
--
PHP Database Maili
On Friday 25 October 2002 16:10, Steve Vernon wrote:
> Hiya,
> I remember ages ago that mysql does not properly handle upwards of 10
> million records in a table?
>
> Any details would be great!
Try it, or ask on the mysql list?
--
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
On Friday 25 October 2002 10:40, Garry Climacosa wrote:
> 6. heres the action page check_act.php
> $file2write = fopen("/var/lib/data/access.temp2.txt", "w");
> $write2line = "$myline\n";
> $filewrite = fwrite($file2write, $write2line);
> ?>
The first thing to check -- did you echo $myline (or $
Hiya,
I remember ages ago that mysql does not properly handle upwards of 10
million records in a table?
Any details would be great!
Thanks,
Steve
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Did anyone hear about "match against" construction? I is easy to build
this:
$query = "SELECT *, MATCH field AGAINST ('$searchwords') as relev FROM table
ORDER BY relev DESC"
(you need do "ALTER TABLE table ADD FULLTEXT(field)" before.
This could be usefull:
http://detail.phpclub.net/download/s
> Hi Guys,
>
> I did try that but I will try it again.
>
> Also, I have echo'd the data and it does appear as I expect.
>
> Any other thoughts while I try this?
Don't know if this has anything to do with your problem, but
> $headers = "Return-Path: <$support_email>\r\n";
should be
> $headers .=
Helo,
why you don't make some kind of "db_connect.php" which will make "mysql_pconnect()"
and include it in top of your first script? You then will be able use mysql query in
everyone of your page. You can also make $mysql_is_connected=true; there and check
that variable in other scrips if nee
32 matches
Mail list logo