Hi there everyone,
Just a quick question which I can't for the life of me find the answer for on MySQL's
website (Probably as i'm looking for the wrong term?) I want to know how to empty a
table, is there an empty command or should I just tell it to delete everything?
Chris
Hi there everyone,
Just a note to say i've fixed the CSV import problem, I had to excape the ' character
that was in the array and now it imports all 1081 rows properly.
Now I can relax and pass out LOL :-)
Thanks for all the help, very appreciated.
Chris
ch is $data[15]; if I remember correctly) it imports over 880
fields, but when that's in it only imports 92 - but I have no idea how to correct bad
characters they may have put in the file (I have no control over the characters they
use - sigh).
I really appreciate your help on this.
Rega
x27;$data[4]','$data[5]','$data[6]','$data[7]','$data[8]','$data[9]','$date[10]','$data[11]','$data[12]','$data[13]','$data[14]','$data[15]','$data[16]','$data[17]','$data[18]','$data[19]','$data[20]','$data[21]','$data[22]','$data[23]','$data[24]')
");
};
echo $count;
fclose ($fp);
Thanks for any help
Regards
Chris
MySQL Manual.
> Option 2 is to use UNIX_TIMESTAMP() in your query to retrieve the MySQL date
> formatted as a Unix timestamp. You can then pass this value to the PHP
> date() function and format it like you have above.
Or option 3: strtotime()
Chris
--
PHP Database Mailing List (http
Hi there everyone,
I'm doing a search in my DB using LIKE '%$word%' which works great, but it's not case
sensitive, so if I search for bike it WON'T find BIKE, i'm using PHP and MySQL.
Probably something very obvious LOL it's just a basic select using LIKE.
Chris
e from a coding point of
view :-)
Again thank you everyone, I don't know what i'd do without you all.
Regards
Chris - Crazy, but slightly less so than this morning :-)
> You may have hit the browser time-out limit, which you can not control (at
> least for IE; don't kno
27;yes';
} else {
$row = 1;
$handle = fopen ("$userfile","r");
while ($data = fgetcsv ($handle, 10, "|")) {
$num = count ($data);
$row++;
echo "$data[0];";
};
fclose ($handle);
}};
Chris
> I've never seen where the file size
o
select their CSV file (No matter what size) and it will insert it automatically, and
as I said it does work on small files but not large :-(
Any help would really be appreciated.
Chris
ke is an
educated guess. SQLite uses the filesystem for storage. If your queries
are needing to access the same file (maybe you're querying the same
table), SQLite is going to serialize those queries to help you avoid
threading problems. So, your queries are going to basically take turns.
Hope th
Hi there Karen,
Thank you you are a star, just tried your idea for the CSV import (With getting rid of
the loop etc ) and it works perfectly, you've made an old man very happy LOL :-)
Chris
Hi there,
Oh I know the , (Or $Delim) isn't the problem, I think your previous email may be the
answer so i'll take a good look at that once i've eaten and if it works you're the
best (Heck even if it doesn't you're all the best on this list ;-)
Chris
T
Hi there,
Yes, in the form itself there is an input field where you specify the
character for import, as default it is set to , but you can change it to
any.
Chris
> On Tuesday 18 November 2003 13:07, Chris Payne wrote:
>
> > > > any ideas? Here's the code:
&
Hi there,
> On Tuesday 18 November 2003 12:34, Chris Payne wrote:
>
> > I have a 2 Column CSV file, and i'm trying to import it into the DB via
a
> > form, I have it importing fine with the first field (Called EMail) but I
> > cannot get it to import the second colum
INTO emaillist (EMail,name)
VALUES ('$data[$c]','$data[$c]')
When I import, it puts all data in the EMail field, even the name field.
Any help would be appreciated beyond belief as this is annoying the crapola out of me
:-)
Chris
justing the include_path.
What's the benefit of using an absolute path? If you did need to change the
include path, you'd only have to do it in one file. Or am I misunderstanding
what you are saying (likely)?
Chris
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Yes you have to break this up into fields that hold your Firstname,
MI,Lastname. This has so many advantages, using PHP string function to
query inside fields might be useful somewhere else, I wouldn't recommend it
for use in a large DB. Divide and conquer!
Espero este consejo te sirva, ese erro
pointers in the right direction :-)
BTW, Using PHP and MySQL :-)
Chris
?
Basically, aswell as sending the ID, I need to send the title and path too and i'm
abit confused.
Any help would be VERY appreciated :-)
Thanks everyone.
Chris
... You mean like taking results
> 1 a
> 2 b
> 3 c
> 4 d
> and changing it to
> 1 2 3 4
> a b c d
> or such? I'm certainly confused.
More or less, yes. exactly that.
Chris
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
> From: "Chris Boget" <[EMAIL PROTECTED]>
> > My bad.
> > If MySQL had crosstab functionality, that *might* be able to help.
> A "crosstab" is just a specifically formatted query, of which MySQL is
> certainly capable of handling. I've d
> result set. Chris, you've made a believer out of me; I'll start using
> mysql_fetch_assoc() for these kinds of queries from now on.
:p
> And in the spirit of only retrieving what you need from the database, I
> would agree that mysql_fetch_assoc() is the "better&quo
I must be quite confused.
No, actually, I am the one who's confused. I misread the OP's email such
that *_assoc() would do the job.
My bad.
If MySQL had crosstab functionality, that *might* be able to help.
But I still stand by my assertion that *_assoc() is better than *_array() in
al
oting down someone who was being helpful, though,
> when I made my response.
It didn't seem like he was shooting you down.
Chris
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
a_seek( $result, 0 );
print_r( mysql_fetch_assoc( $result ));
echo '';
?>
Especially if you use the foreach() construct, mysql_fetch_array() is bad
news.
Chris
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
> mysql_fetch_array( $result )
Actually, for an associative array (which the OP had made reference
to), you use mysql_fetch_assoc().
I avoid mysql_fetch_array() like the plague unless there is a very
specific need.
Chris
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, vi
gt; > http://personals.yahoo.com.au - Yahoo! Personals
> > New people, new possibilities. FREE for a limited
> time.
You can put together WHERE statements with an AND or an OR. For
instance, "SELECT id FROM users WHERE id='2' OR id='3'"
You know, if you had
You are using a variable outside of the function's scope.
In the function, do this:
global $username;
Visit www.php.net/man to get a better understanding of globals and
scope.
On Wed, 2003-10-15 at 22:10, Adam Symonds wrote:
> Hi,
> I am starting to us functions with my work but I am having troub
> How do you pass by reference? I tried
> $var = myFunction(&$var1, &$var2);
> but it gave me a warning saying that pass by reference is depreciated
function myFunction( &$var1, &$var2 ) {
}
You now have to do it in the function definition, not the function call.
,
'$ForumID','$posted','$parentid')
");
But once it has done this, I need to get the id it has generated in the DB and then
update that record with the id it generate, so how can I get the id from the above
insert?
Any help would be greatly appreciated :-)
Regards
Chris
connection to the database. Regular connections work fine. This used
to work fine for a long time, and now it's not working. Any idea why
this isn't working or how I could fix it?
Thanks in advance for any help,
Chris Frederick
--
PHP Database Mailing List (http://www.php.net/)
T
You can always try indexing your data, this will improve your query speeds.
Don't know how you are quering data, but would suggest using keys and
"optimized" query expressions. You should also check your Win 2000 services
running and anything that might interfere with your setup (ie: antivir,
etc)
Hi there,
Thanks for your help :-) Oh and I did read the manual, found it about 20
minutes after I sent the emeial but got sidetracked and forgot to post i'd
figured it out in the group - sorry :-)
Chris
> On Mon, 22 Sep 2003 16:04:06 -0400
> "Chris Payne" <[EMAIL PRO
iable error, any ideas?
BTW, I haven't touched your functions so they are the same as you sent to
the list, I just changed the details for my pop3 server which logs in fine
as if I put in a wrong password it knows it's wrong :-)
Chris
> On Sunday, September 21, 2003, at 11:58 PM,
Hi there,
Thanks for that, very appreciated, just one question? Without meaning to
sound dumb (Which I probably will) how do I call your function? I don't
usually deal with functions, I know I need to start though .....
Chris
>
> On Sunday, September 21, 2003, at 10:53 PM,
can
insert selected data into a database backup (Hard to explain).
Any help would be really appreciated :-)
Regards
Chris
I found phpchartdirector to be a nice third party app
http://www.hotscripts.com/Detailed/12237.html
- Original Message -
From: <[EMAIL PROTECTED]>
To: "Balaji H. Kasal" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>; "PHP
List" <[EMAIL PROTECTED]>
Sent: Tuesday, September 16, 2003 10:12 AM
Su
t; suggestions?
if( isset( $_POST['keyword'] ) {
foreach( $_POST['keyword'] as $checkboxValue ) {
echo 'Checkbox ' . $checkboxValue . ' was checked';
}
}
Chris
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
f I haven't confused you all to death
:-)
Regards
Chris
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
g that solution out, it SHOULD work :-)
Chris
> Well...
>
> Having never done this I would assume it's the same with and form field
> you want to use as an array (multiple selections).
>
> Create a few different fileselect fields all with the same name but
> adding in [
?
The image info is stored in a DB and the images themselves are on the server, this way
I can do lots of nice things to manage the images that have been uploaded without
having to access the filesystem too much (I love PHP and MySQL, makes it so easy).
Thanks everyone.
Chris
.
I appreciate your help very much though, as sometimes the most annoying
problems have the simplest solution (I'm an annoying problem but the only
solution to me is to shoot me LOL :-)
Chris
> Chris,
>
> Wild guess here, but could this problem possibly be caused by your web
on Windows XP - the only difference is
I use XP Pro for dev work.
Very odd.
Chris
> Is is just your site. does he have problems with other internet/php
sites?
> i.e www.php.net?
>
> jeff
>
>
>
> "Chris Payne"
> &
Though as I said before, PHP and MySQL aren't selective when they
run and when they don't, they either work or you get horrible error messages
:-)
Chris
> Chris,
>
> Like you say doesnt seem to be php, I'd be suspecting XP's firewall
settings on his dial up connection, can you
Sorry everyone, forget my last post about the T_Variable, I was right it WAS a stupid
question LOL :-)
Chris
Hi there everyone,
I have image details stored in my DB, and i'm trying to remove the ones I select, but
I keep getting an error saying that there is an unexpected T_Variable, can anyone see
what is wrong here? It's probably obvious, but for the life of me
if (count($del) >= 1) {
for
#x27;t,
could it be his installation of Explorer? He's on dialup in the UK, but my friend
from the UK is on broadband with the same setup and it works fine for him.
Sorry this isn't an actual PHP/MySQL technical question, but I thought that somebody
might be able to back me up as I think it's his browser.
Any thought?
Chris
yADMIN and exporting 1
DB at a time is going to take forever.
My Server is the Rehat Linux 8.0 with Apache and MySQL and PHP.
Thanks, any help would be really appreciated (And save me alot of headaches).
Chris
to go
through the CSV file, and import the EMail addresses into a record of their own (IE:
id1,id2,id3 rather than all in 1 row)).
Any help / code tips would be REALLY appreciated :-)
Regards
Chris
:-)
Thanks
Chris
Just a thought :-)
Chris
> Hi,
> I have to manage a large amount of images uploaded by users on my site.
> Using php/mysql I don't know if I should store the images in a directory
> within the server or in a dedicated table.
> What is the most suited method?
> Thanks, best regar
Hi there,
Ahhh you're a life saver, thanks for that that really helps out alot - and
makes sense when I think about it :-)
Regards
Chris
> For each message have a autoincrement message ID, an INT field is
sufficient I
> would guess.
>
> Also in each message record, have a
al posters message.
Any help would be VERY welcome.
Regards
Chris Payne
fo for the message listing. The forum name is NOT stored in the actual
messages table, it's in the forum index table I created.
The code I use is:
Thanks for taking a look :-)
Chris
Read: http://www.mysql.com/products/licensing-examples.html
===
"Richard" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hello
>
> I hope this is a rumour but I heard that MySQL is now fully GPL which it
> wasn't earlier.
> I think the part used to communicate with the
Try reading this on PHP site, documentation here is pretty useful.
http://us4.php.net/manual/en/ref.mssql.php
Suerte.
==
"Jean Fernando Ortiz" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi all!
> I need to know how I must connect to MS SQL Server 2000 in a Win
PHP or JScript will do it.
Thanks
Chris
You can achieve much more with a Database backend, if your boss likes
spreadsheets (XLS) then you can always export from any database backend
(which ever one you want). He can still keep hyperlinks etc for web access
etc if he would display the database results onto webpages/excel/text/etc!.
Perha
When I get a warning like below, is that something I can fix by modifying
the code? or is that some configuration that need to be changed on the
server?
Warning: unable to create file files/sked.html because Permission denied in
/server3/home/cjmach/public_html/newfile.php on line 14
I get this w
If it is possible, could some one point me in the right direction. Like
where to look in the manual.
Thanks,
Chris
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
nes / paragraph
formatting.
Any help would be appreciated :-)
Chris
Hi there,
Ahhh thanks, that was a quick way to do it, I took the long way around LOL
:-)
I grabbed the data, did $article = str_replace("", "", $article); and
then looped through all of the entries to change it, it seems to have worked
though :-)
Chris
> Chris Payne
DB).
Using PHP, how can I write a simple script to go through all the entries for a column
(Called articles) and remove all instances of or ??? It would take far too
long to do it page by page :-(
Thanks for all your help everyone.
Regards
Chris Payne
Thanks guys!
number_format() works great!!
"Chris Mach" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Is there a function that will strip or add commas?
>
> I'm trying to do calculations with attendance numbers of football games...
> for example:
Is there a function that will strip or add commas?
I'm trying to do calculations with attendance numbers of football games...
for example: 33,153
right now I don't have a comma for the numbers in the database. So the above
example is 33153 in my database. If I put the comma in, when I try to do
late the second box without
having to refresh the whole, page so any ideas/examples would be very welcome :-)
Thanks for everything.
Chris
Go to http://www.mysql.com/downloads/api-myodbc.html or
http://www.mysql.com/downloads/api-myodbc-3.51.html and download the driver
for linux.
Hope this is what you were asking for.
Chris
=
"Nabil" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I h
everyone as my brain has probably fried :-) But here's the code, when I
convert it back to d,m,Y it says it's 2004 which it shouldn't.
Thanks
Chris
---
$secsinweek = 604800;
$numweeks = $secsinweek * 7;
$curdate = date("d-m-Y");
// Split the strings into day,
Hi there,
The problem is the data is already in the DB, it was mass-added with the '
already there, what I need is a way to retrieve the ' that is already in the
DB.
Thanks
Chris
> yes, by adding stripslashes it will somewhat escape those quotes ('),
> but when display
nd stripslashes etc . but not sure if that's relevant to this being
that the data in the DB has a single ' already there.
Anyway help would be appreciated :-)
Regards
Chris
I am running PHP 4.3.2 and MS-SQL 2000. I am trying to run some sample
code to make sure all works well.
The code below works fine. It simply inserts a record into a table. This
is done in the stored procedure code on the SQL server.
Code that works:
$myServer = "192.168.200.28";
$myUser = "s
Hi there,
Thanks just found this page as your email arrived :-) Appreciate the
pointer though.
Chris
> http://us4.php.net/manual/en/function.getimagesize.php
>
> > Hi there everyone,
> >
> > In short, I use the following to upload an image to the server:
> >
uploaded image so
that I can store this information in the DB?
Thanks for your help everyone :-)
Chris
On Wed, 18 Jun 2003 16:06:23 -0400, Chris <[EMAIL PROTECTED]> wrote:
I've done a google search, but most of the results are for the part I've
already figured out. People that have the "top 10" sorting usually want
money for their system (one wanted an absurd $500).
I've done a google search, but most of the results are for the part I've
already figured out. People that have the "top 10" sorting usually want
money for their system (one wanted an absurd $500).
I'm working on a database application where users vote on how much they
like a particular picture
On Mon, 16 Jun 2003 21:13:14 -0500, Norma Ramirez - Tecnosoft
<[EMAIL PROTECTED]> wrote:
Hi all,
I´m starting with posgresql and i trying to use pg_last_oid to get the
last id in a insert query, but this function returns me a big number like
21318 and bigger, but the table just have 3 or 4 reco
I put it into a text block thinking that the HTMl
caused a problem but it doesn't.
Anyway help would be appreciated as it's driving me nuts :-)
Chris
Antigua claim to have a different beach for every day of the year although we have not
visited them all the islands many beautiful sof
Hi there,
Thanks for your quick reply, very appreciated :-)
Chris
> hi
>
> you can easily do this by using
>
> mysql_insert_id();
>
> see
> http://www.php.net/manual/en/function.mysql-insert-id.php
>
> .ma
>
> e: [EMAIL PROTECTED]
> w: http://www.ab
Hi there everyone,
I'm creating a new entry using the following:
mysql_query ("INSERT INTO agents (agent_name)
VALUES ('$agentname')
but I need to find out the ID value it created, how can I do this easily?
Thanks
Chris
advantages of upgrading to 4.0 ?
Will I need to recompile PHP to use MySQL 4? This kind of thing is new to me (Linux
as I used to use Windows).
Thanks for everything.
Chris
My database is set up in this way:
fan_roster: has player id (play_id) , week, and stats on that player for
that week. So there are 20 records for each player, because there are 20
weeks.
So what I need to do is add up all the players weekly totals. so pass_yrd1
for week1 + pass_yrd1 for week2 et
= str_replace("'", "''", $value);
>
> - Frank
>
> > Don't. addslashes() instead.
> >
> > Chris Mach wrote:
> >
> > >does anyone know how to strip a ' from a string? It's causing errors
> for my
> >
does anyone know how to strip a ' from a string? It's causing errors for my
sql statements
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
wrong as i'm new to unix, sorry :-)
Slightly OT, but is it possible to run certain Linux Commands via PHP? I'd like to
write a script where I can do CHMOD and CHOWN via a secure web interface rather than
having to login via SSH.
Thanks everyone, have a great day.
Regards
Chris
Does anyone know how to join cursors after having successfull query ie:
I have multiple queries that get data from different sources and now I need
to join the results, how can I achieve this in PHP (Do I need to write into
a temporary table and then requery? is that the only way? I am using MyS
Does anyone know how to join cursors after having successfull query ie:
I have multiple queries that get data from different sources and now I need
to join the results, how can I achieve this in PHP (Do I need to write into
a temporary table and then requery? is that the only way? I am using MyS
1 needs this, which is why i'd rather have it set in the PHp
script than in the php.ini or some other way.
Sorry if i've confused you LOL.
Chris
Hi there,
I have an SMTP server on here (Imail) - how would I use it with PHP? Any
tips to send a quick email as a test?
Thank you :-)
Chris
> You have two options. First option is to get sendmail for windows.
> You're going to pay for this, but there is a sendmail replacement fo
rewrite my form code it will take weeks LOL :-)
Thanks
Chris
aight right
now :-(
Thanks
Chris
---
while ($row = mysql_fetch_array($sql_result)) {
$emailadd = $row["EMail"];
$emailname = $row["emailname"];
$emailphone = $row["emailphone"];
$emailaddress = $row["emailaddress"];
};
> You could change the TO:
the newsletter
any faster? I've probably gone about
this system the long way, but it works - I just need to find a way to
make it faster :-(
Thanks everyone
All the best
Chris
---
";
$HT = "";
$subject = "$subject";
$NOTE = "$emailtests";
$NOTE = s
Hi there,
Thank you John, you are a lifesaver :-)
Chris
> > I have a form which displays 3 dropdowns, day, month and year, I have
> it
> > displaying the default of the dropdown for month no problem, but how
> can I
> > get it to select the current date (day) in the drop
important even though it sounds odd :-)
so if it was the 5th of a month, it would show 5 as a default value, but allow you to
select 1-4 before that and 6-31 after it.
Thanks everyone
Chris
e CGI version of PHP? All the bits i've found online is for mod_php or
something? Windows is easier and setup fine but I decided it's time to really get my
hands dirty (God help me :-)
Thanks everyone.
Chris
).
Is there an easy way to write a short PHP script that will populate the field $stock
with 3 years dates in advance from the current date, using the format 02-03-200x ?
it's either this way or I go through and insert new onces argghhh (That's not a
pleasant thought :-)
Thanks :-)
Chris
> FYI: Make sure you addslashes() _after_ you serialize your array if it can
> contain quotes. Everything else remains the same.
Yeah, my bad. Good catch.
Chris
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
DimArray = unserialize( $fetchedRecord['field1'] );
$multiDimArray = unserialize( $fetchedRecord['field2'] );
serialize() is your friend when it comes to storing arrays in
a DB field.
Chris
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
nking DSL would be better if I run my actual
server from here, any thoughts?
Sorry that this is somewhat off topic (But not totally) but everyone on here is very
noligable and PHP is the main theme of the server i'll be setting up.
Thanks :-)
Chris
I can hardcode the year without a problem.
Any ideas how I could do this?
Thanks for everything, you are all life savers. Oh and after thinking about it I
realized how dumb storing Credit Card details in a DB were :-)
Chris
Hi there everyone,
Thank you all for your answer - DOH I can't believe I missed something so simple :-)
Regards
Chris
901 - 1000 of 1258 matches
Mail list logo