> if(!session_is_registered("UserID"))
> {
> header("Location: login.php");
> }
>
> else
> {
> ... some other stuff, if user is logged in...
> }
againthis must be put before there is any ouput to the page. Before
or even a blank space. This includes any files that are included
before t
> I'm getting a strange error message from calling this function
>
> It spits out
> This is my query:
>
> SELECT dept.name, count(maintenance.deptid)/$total AS percentage FROM
> maintenance
> JOIN dept WHERE maintenance.deptid=dept.deptid GROUP BY dept.name
>
> This query runs fine in console I j
> So what does set_magic_quotes_runtime(0) do then??? Will it shut off the
> automatic backslashing of single quotes at run time or not? (it certainly
> doesn't seem to)
It will turn off the escaping of quotes from data your script reads while
it's executing, namely from data returned from a da
> New PHP (long time PERL user) here. I am using an Access database -
> yeah I know Access is crap, but I have no choice. Anyway, it seems that
> this magic backslash thing is unavoidable. As I understand it, I can shut
> it off at the .ini level, but I am running this app on a hosted server
wi
> Or this works well too and might be faster for the DB.
>
> SELECT * FROM SomeTable WHERE create_date BETWEEN $start_date AND
> $end_date
Benchmark it yourself, but I've found that BETWEEN is slower. It's easier to
read, though.
---John Holmes...
--
PHP Database Mailing List (http://www.php.
> I am trying to find the records whose create dates (field name
> =create_date) are between the ones I want .For example , I want to seee
the
> records between $start_date and $end_date ..So I tried the code
> below..But it looks not that right to me?...
>
> select * from bug where ..
> I have set up a section of my company site for use by authorized dealers
> only. I am currently using
> mysql authorization, which works for the first page, but if someone were
to
> type in the url of an
> underlying page they would be able to get in without authorization. I know
> I could use .
> > $res = mysql_query ("SELECT COUNT(deptid) FROM maintenance GROUP BY
> > deptid");
> > $deptcount = array(); // reset the array
> > while ($row = mysql_fetch_row ($res)) {
> > $deptcount[] = $row[0];
>
> this should be $deptcount[] .= $row[0]; shouldn't it?
No. The way it's written is it's a
Why do you need the secret variable? If your server is set up correctly, the
user can't create any session variables, all they can do is create a session
ID. So you could just check for a user-id and you'd be good.
---John Holmes...
- Original Message -
From: "Jackson Miller" <[EMAIL PRO
You can't start variables with a number.
---John Holmes...
- Original Message -
From: "Hutchins, Richard" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, September 26, 2002 4:18 PM
Subject: [PHP-DB] Return Array from Function
> Can somebody tell me what I might be doing wro
$bgcolor = ($count++ & 1) ? "blue" : "black";
Then use $bgcolor in your
---John Holmes...
- Original Message -
From: "Rodrigo" <[EMAIL PROTECTED]>
To: "PHP" <[EMAIL PROTECTED]>
Sent: Thursday, October 03, 2002 8:29 AM
Subject: [PHP-DB] Table question
Hi people, is there a way to
> I have a database (mysql) that has some rows entered.
>
> Format:
> Name | Desription | catid
>
> This has some info in it like this
>
> Joe Man 1
> Jack Man 1
> Jacky Female 2
> Emily Female 2
>
> What I am trying to do is create dynamically created select lists so
> that all with catid 1 are i
> What does everyone typically use to display the results of a query. For
> example, I have a database that has a series of subjects and grades. If I
> select * from the table, I want a nice way for the data to be displayed.
In
> cold fusion, I can simply use a grid that dynamically fills in. C
Remove all of the @ for one, so you can see if there are any errors. You're
using $rs as two different variables, also. Check mysql_error() after your
query to see if an error is returned.
---John Holmes...
- Original Message -
From: "Frederick Belfon" <[EMAIL PROTECTED]>
To: <[EMAIL PRO
> I need to know how to retrieve a date field from a database
> table using MYSQL_DB_QUERY to create recordset. As well as
> writing a Date Variable to a table using MYSQL_QUERY .
For one, don't use mysql_db_query(), it's depreciated.
You'd use mysql_query() for both instances and
m
One of the most popular template engines is Smarty. Search on google for it.
There are plenty of others and even some modules that can be installed into
PHP for faster performance.
YOu can easily seperate logic from presentation with PHP, but most people
choose not to. For most simple projects ou
> Is there an easy way to have MySQL return someone's age based on their
> birthdate? For some reason I just can't figure this one out.
select year(current_date) - year(dob) -
(if(dayofyear(dob)>dayofyear(current_date),1,0)) as Age from yourtable ...
where dob is your date of birth column. curre
> I have a table something like this:
> __
> | id | number |
> | 1 | 1 |
> | 2 | 23|
> | 3 | 59|
> | 4 | 103 |
>
> If I have a number, say 30, I need to get the last number it's above -
> in this case id 2. Any ideas?
$number = 30;
SELECT id FROM table
> hello, at my company we have several network printers and i was was
> wondering if it's possible to print directly to them using PHP, instead
> of showing on the screen or both ...
> to gain more control on what is printed, because of the nasty browsers
> header and footer ... whom i now how to r
__LINE__ and __FILE__ should work.
---John Holmes...
- Original Message -
From: "Peter Beckman" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, October 23, 2002 3:00 PM
Subject: [PHP-DB] Function that outputs "at line xxx"
> Hey --
>
> I'm writing a database error handler fu
quot;Peter Beckman" <[EMAIL PROTECTED]>
To: "1LT John W. Holmes" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Wednesday, October 23, 2002 3:26 PM
Subject: Re: [PHP-DB] Function that outputs "at line xxx"
> John, that does work! Thanks.
>
> The
When ever I see "easy", "encrypt", and "credit card" in the same sentence,
it makes me worry.
Don't store credit card numbers. Charge them once and don't save it
anywhere.
---John Holmes...
- Original Message -
From: "Ryan Jameson (USA)" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent:
y come with all of the scripts you need
to implement it.
> Thery is wonderful, however, practicle must preside.
Hmmm, that's funny. I would think that _security_ must preside. Maybe I run
a different business than you do.
---John Holmes...
> -----Original Message-
> F
> Here's what I'd like to know: Is there a PHP function for easily finding
and removing a line >from a flat file of data. And, if not, is there a way
to remove a line (or lines) after finding them >using fget()?
Easy way to do this is with file(). It'll read the entire file into an
array, with eac
> 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
You might want to check out netpbm. I've seen that it makes better quality
thumbnails.
Plus, you can include it in your package (if appropriate) and people that
don't have GD installed can use it.
---John Holmes...
- Original Message -
From: "Rankin, Randy" <[EMAIL PROTECTED]>
To: <[EMAI
> Can u pls help in "Converting database from MS Access
> to MySQL on Linux". Pls send the code for converting.
http://www.google.com/search?hl=en&ie=UTF-8&oe=UTF-8&q=Converting+database+f
rom+MS+Access+to+MySQL+on+Linux
---John Holmes...
--
PHP Database Mailing List (http://www.php.net/)
To u
You don't need filesize().
$fp = fopen('address_to_image','r');
while(!feof($fp))
{ $image .= fread($fp,1); }
Something like that will work...
---John Holmes...
- Original Message -
From: "Marcus Fleige" <[EMAIL PROTECTED]>
To: "PHP-Mailinglist" <[EMAIL PROTECTED]>
Sent: Tuesday, O
- Original Message -
From: "Erick Wellem" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, October 30, 2002 6:44 AM
Subject: [PHP-DB] Retruning an array from a row
> Hello All,
>
> How can I return and print an array from a user defined function from
> a database from a row l
> I'm my trying to insert to current date from a php form? I know that
> MySQL has a CURDATE() fucntion and PHP has several date function, but I
> cann't seem to get either to work? Here is my existing code:
> $ADDDATE=date("Y-m-d");
[snip]
> VALUES ('$_POST[ADDDATE]',
You've got two
So show us the code that you tried with. This code doesn't do us any good
because it's not causing the error.
---John Holmes...
- Original Message -
From: "David Rice" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, October 31, 2002 11:31 AM
Subject: [PHP-DB] need help with "S
No, you're doing it wrong.
---John Holmes...
- Original Message -
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, November 01, 2002 2:05 AM
Subject: [PHP-DB] Am I doing This Right?
>
>
>
> function war3_replays_submit() {
>
> if ( isset($replay_file) ) {
> $
That's not true. You can assign them to different variables and it works
fine.
$r1 = mysql_query("select * from main limit 1") or die(mysql_error());
$r2 = mysql_query("select * from apft limit 1") or die(mysql_error());
$row1 = mysql_fetch_array($r1);
$row2 = mysql_fetch_array($r2);
print_r($ro
> I was wondering if it is possible to protect my password to the
MySQL-server
> from being in a PHP-script. Now I can't do that, so everybody who gets to
> see my php-sourcecode also can see my (not protected/not encrypted)
> password.
> How can I change this?
You can't, unless you want to put i
AIL PROTECTED]>
To: "'1LT John W. Holmes'" <[EMAIL PROTECTED]>; "William Trappeniers"
<[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Wednesday, November 06, 2002 5:30 PM
Subject: RE: [PHP-DB] MySQL password protection?
> actually you can make a
How about:
$sql = " ... ";
$result = mysql_query($sql);
if($row = mysql_fetch_row($result))
{
do
{
//process results in $row
}while($row = mysql_fetch_row($result);
}
else
{ //no results }
This way you don't have to make an extra call to mysql_num_rows() and it
saves you time.
---John
> OK. If I am using the POST method and the checkbox 'name' for all
> of the checkboxes is 'system', how do I access the results? I am
> researching on the PHP site trying to figure out what this array is, and
how
> I access this if the index name is the same for all elements. I am hoping
> that
Have you looked at the nl2br() function?
echo "" . nl2br($content) . "";
That may give you the output you're looking for.
---John Holmes...
- Original Message -
From: "Griffiths, Daniel" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, November 19, 2002 11:50 AM
Subject: [PHP-
> Hi all,
>
> I am karthik. I am using using php with mysql. i am stuck with a qury. Pls
hep me out.
>
> i have two tables. Here is table with sample data
>
> Table Name : Links
>
> linkid header
> 1 yahoo.com
> 2 google.com
>
> Try... $query = "INSERT INTO accounts (accnts,timestamp)
> VALUES(''.$accnts[0].'','TIMESTAMP(10)')";
>
> Might work?
>
> Aaron
>
For the OP, you don't really want to insert the text TIMESTAMP(10) into a
column, do you? If you want the current 10-digit timestamp, then you can
just use NOW() or C
> OK. This sounds great, but now I am getting a completely different
> error message.
>
> You have an error in your SQL syntax near '-sys) VALUES('sn4265-turner')'
at
> line 1
>
> Here is the INSERT statement:
>
> $query = "INSERT INTO accounts (id-sys) VALUES('".$accnts[0]."')";
>
> Do I have to
> $query = "INSERT INTO accounts (`id-sys`, rtime) VALUES('".$accnts[0]."',
> 'NOW()')";
Remove the quotes around NOW(). It's a function, not a string.
---John Holmes...
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
> I am currently creating a php/mysql site for a client. Many of the
> customers who will be using this site also use a vb/access program to
store
> a lot of the same data. The client asked me last night if we could write
an
> app that would run on the customers machine that would routinely take
You may want to check out using Nested Sets instead of a Parent-Child-ID
system. I think it's an easier system for representing hierarchies. Here is
a good article on the system:
http://searchdatabase.techtarget.com/tip/1,289483,sid13_gci537290,00.html
Google for Nested Sets +sql or something and
HTML doesn't render newlines, only . Look at your HTML source code and
the newlines are there.
or,
if you're on windows, use \r\n for newlines.
---John Holmes...
- Original Message -
From: "NIPP, SCOTT V (SBCSI)" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, December 05, 2
I think he meant that he is only pulling one column, i.e. "field1" with each
mysql_fetch_array and he wants that in four columns.
$c = 1;
echo "";
while($ar = mysql_fetch_array($result))
{
echo "{$ar['field1']}";
if(($c % 4) == 0) { echo ""; }
}
You'll have to account for incomplete rows and
> I know a lot of sites, such as car dealerships, where you can put in your
> zip code and then you can search for cars within 50,100, etc miles of your
> house. How is this done? I have a site that we want to implement a
feature
> like this. What is stored in the db? Can I simply write a funct
> How do I get MySQL to summarize a query so that I receive only 1 instance
> per similar record. I.E. if you have 10 records with name "Smith" and 5
> records with "Barney, etc, that it would return 2 records instead of 15.
This should be on a MySQL list...
SELECT * FROM tbl WHERE ... GROUP BY
> $tmp = $_POST['sbcuid']."-".$_POST['system'][$a];
> $update = "UPDATE accounts SET atime='NOW()' WHERE
> \"id-sys\"='".$tmp."'";
> echo $update;
> $result1 = mysql_query($update, $Prod) or die(mysql_error());
> echo mysql_affected_rows();
Try:
$update = "UPDATE accounts SET atime=NOW() WHERE id
> I have definitely isolated the problem. If I change the column name
> that the match is being performed on from 'id-sys' to 'id_sys' I can
execute
> the query without having to worry about quoting the column name and
> everything works. I think that I am just going to leave the column name
> ch
> I am very new to the world of PHP, and still trying to get my foot in the
> door. Not doing too bad so far, good fun it all is... but i am having a
> problem working out what exactly the problem is here with sessions.
>
> Here is the code for page one of the tutorial, i copied it straight from
>
> Warning: open(/tmp\sess_1df563d6d8c8b4b16534c438251e7107, O_RDWR) failed:
> No such file or directory (2) in E:\Webroot\tutorial\page1.php on line 3
>
> Warning: open(/tmp\sess_1df563d6d8c8b4b16534c438251e7107, O_RDWR) failed:
> No such file or directory (2) in Unknown on line 0
>
> Warning: Fail
> mysql_insert_id() is a PHP function, not a MYSQL function. You are also
> missing a close quote on your insert string. So you have to do it like
> this:
Correct, but LAST_INSERT_ID() is a MySQL function which is what he's
using...
> $sql2 = "insert into acl (adminId,transportId,securityId
> I have a few hundred rows of data to import into a mysql db. Its currently
> tab separated.
>
> What's the most straight forward way (ie i dont want to enter it line by
> line) of doing a bulk import?
>
> I have full admin rights to my dev server. Is there a method or software
app
> that people c
> LIMIT 5,10
> LIMIT 10,15
>
> Something like that should work.
Not quite. LIMIT n,m where n is the starting point and m is how many rows
you want returned.
LIMIT 5 or LIMIT 0,5
LIMIT 5,5
LIMIT 10,5
etc...
---John Holmes...
> Im using MySQL and PHP 4.2.3 on Apache and Mandrake Linux, I was
> wo
Do you have root access to the internet MySQL server? The easiest way to do
this would be to use replication, I think. It doesn't sound too difficult to
set up and it would do all of the updating for you. Is that an option? If
not, then you can enable binary logging (I think that's what it is) in y
> I'm trying to insert a URL into a char field.
>
> MySQLFront punts out this error with my compiled query:
>
> You have an error in your SQL syntax. Check the manual that corresponds
to
> your MySQL server version for the right syntax to use near '','Yahoo
> mail','httpNULL/www.yahoo.co.uk/')'
>
If you don't know how many nodes you're going to have and the amount of
branches under each node, then that's the only way to do it.
However, if you can define those numbers, you can use something like the
following. A manager would have 50 numbers, for example. So, rather than
counting through th
> Everything's perfect.. except my browser keep blank when I run my php
> files...
No, obviously it's not perfect because it's not working at all. Your page is
blank because will be evaluated as an unknown HTML tag and
come out blank.
Find another tutorial that discusses how to set up what you w
> I don't know where the error lays, in php, mysql or red hat 8.
> But, I can't get my databased php-apps to work.
> I am trying to run:
>
> apache_1.3.27
> php-4.2.3
> mysql-3.23.53
> redhat 8.0
>
> What happens is that apache and php work nicely, but my apps cannot
connect
> to mysql. In IRM I ge
> > I don't use RedHat, but I've heard (possibly here) that the RH PHP
> > RPM does not properly install MySQL support by default and that
> > there's something like php_mysql.rpm (or something similar) that
> > needs to be installed as well? Does any of that sound familiar to
> > anyone?
> >
> I'v
> >> I don't know where the error lays, in php, mysql or red hat 8.
> >> But, I can't get my databased php-apps to work.
> >> I am trying to run:
> >>
> >> apache_1.3.27
> >> php-4.2.3
> >> mysql-3.23.53
> >> redhat 8.0
> >>
> >> What happens is that apache and php work nicely, but my apps cannot
>
You can specify a padding character and length with printf
www.php.net/printf
---John Holmes...
- Original Message -
From: "Martín Agüero" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, January 06, 2003 9:52 AM
Subject: [PHP-DB] Help about printing an integer variable
I need
> I am able to get the query to work by itself but it will not work using
> the if (isset ($submit)) and NO errors are outputting...nothing.
That's because $submit is not set
> Any suggestions would be greatly appreciated. I havnt even gotten to
> the form variables yet...and yes, my glob
> When I post to my next page in the survey in the form action, instead of
> this page, the data doesnt go into the database.
>
> Does anyone know a way around this other than rewriting all the pages
> into one page?
Use sessions or hidden form fields to transfer the data between pages.
---Joh
olmes...
> Actually, I dont need these variables in the rest of the form, I just
> need to go to the next page...Like a hyperlink on the submit button
> maybe ???
>
> Seems like I've seen that...
>
> Mignon
>
>
> On Wed, 2003-01-08 at 14:12, 1LT John W. Holmes wrote:
> Hello every one. I am still learning how PHP works. Can some one answer
> this
> for me please.
>
> This piece of code here works fine ONLY without the HTML tags (The
> first line and the last lines in the code).
> The moment I add these lines I get the following error: (By the way I
> don't ge
> I want to be able to load PDFs into mysql DB, but I'm not very familiar
with
> the blob data type?
> Can someone point me on the right direction how to do this?
Use fopen() in binary mode and fread() to read the file into a string, then
insert it into the
database as you would any other variable
[snip]
> if ($dateDiff == 3) {
> mysql("$DBName","UPDATE Balances SET CompEarned=CompTaken+8 WHERE
> said='$said'") or die(mysql_error());
> mysql("$DBName","INSERT INTO Log VALUES('DATE_ADD($StopDate,
> INTERVAL 1 DAY','',1,2,'$CalendarDetailsID')") or die(mysql_error());
>
> My big question is ab
> [snip]
> > if ($dateDiff == 3) {
> > mysql("$DBName","UPDATE Balances SET CompEarned=CompTaken+8 WHERE
> > said='$said'") or die(mysql_error());
> > mysql("$DBName","INSERT INTO Log VALUES('DATE_ADD($StopDate,
> > INTERVAL 1 DAY','',1,2,'$CalendarDetailsID')") or die(mysql_error());
> >
> > My bi
> Is there any way to receive mail via PHP?
>
> What I am interested in doing is creating a double opt-in e-mail list
> whereby someone can subscribe to an e-mail service via an on-line form.
Upon
> doing so, they would get a confirmation e-mail. Replying to this e-mail
> would confirm the subscrip
> > > mysql("$DBName","UPDATE Balances SET CompEarned=CompTaken+8 WHERE
> > > said='$said'") or die(mysql_error());
> > > mysql("$DBName","INSERT INTO Log VALUES(DATE_ADD($StopDate,
> > > INTERVAL 1 DAY,'',1,2,'$CalendarDetailsID')") or die(mysql_error());
> Actually this is generating another err
if(category = 'bla')
Maybe you shouldn't be using a constant if it's going to be changing each
time the page loads.
---John Holmes...
- Original Message -
From: "Shachar Tal" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, January 23, 2003 7:46 AM
Subject: Re: [PHP-DB] While
You could also use this:
function getdomainname($name)
{
$parts = explode('.',$name);
return $parts[count($parts)-2];
}
which will always return the second to last section when divided up by the
periods. So it will return 'domain' for all of the following:
www.domain.com
www.subdomain.do
But what about www.domain.co.uk, you ask? Well, it'll fail with this. :)
Just filter out the 'co.' like the other function that was posted and this
will still work.
---John Holmes...
- Original Message -----
From: "1LT John W. Holmes" <[EMAIL PROTECTED]>
> any idea what this means? i have not touched or changed my
> config.php file since i put it up the first time... it contains my db
> connect info. also, i just downloaded it from the server to see if it
> had been modified and it had not. thanks again and best, addison
>
> Warning: Too many conne
> I've been checking the last_insert_id() function out and I am curious. The
> MySQL docs say to use the mysql_insert_id() function after an "insert
into"
> query to grab the key value. Both seem to work; however, there are some
> subtle differences.
>
> Which is the best one to use after a single
- Original Message -
From: "Addison Ellis" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, January 28, 2003 10:46 PM
Subject: [PHP-DB] sql syntax error
> hello,
> i can not pinpoint this. your time and help is very much
> appreciated. best, addison
>
> Error:
> id=, HTTP_POS
> I wondered if anyone could help me.
> I would like to store the user IP only once
> per multiple visits.
> The code below store the user IP on every visit
> which is not my intention.
> Please I would like to have the IP stored at once upon
> repetitive visits of the user.
> Thank
> Below is my c
> > Make your 'ip' column UNIQUE in your table and ignore errors.
> > Or, set a flag in a session or cookie when you save the IP and if that
flag
> > is present on other pages, then don't save the IP.
>
> Or I believe you can use REPLACE INTO...
True. I don't think all databases implement REPLACE,
> $sql = "SELECT * FROM accessnums WHERE areacode=$_POST[areacode]' and
city='$_POST[cityselected]' ORDER BY network LIMIT 1";
>
> It can't execute the query. Any suggestions?
Unless it's a typo, you're missing a single quote around $_POST[areacode]...
---John Holmes...
--
PHP Database Mailin
> I am trying to decipher some code written by someone else. In it there
> is a query:
>
> $query = "select description from $prodtable where description like '%'
> or type like '%' group by description";
>
> I've seen it used as mathematical modulos, but not sure how it's used
> here.
It is a wi
> I have just began work on a project to let users subscribe to a service
and
> place orders into a database that is VFP 6 based.
>
> Using PHP4, I am able to interface with their program (that also uses ODBC
> locally) in all aspects (INSERT, UPDATE, DELETE, and SELECT).
>
> My worries come when i
> when retrieving data from the db and displaying it on the
> page by creation date how can i reverse the order so that the most
> recent entry appears first? here's what i have now:
>
> require("config.php");
>
> $obj = mysql_db_query($dbname,"select * from ads order by
createdate");
> ?
> i do print_r($row); and all my data is printing properly from
> my db. however, with the below code only one row is not printing:
> {$row->property_type}
> thank you for your time. addison
>
> // Begin Ad Block
> $count = 0;
> $id = 45;
> $obj = mysql_db_query($dbname,"select
> I am working on an app that needs to post information to a website
> based on date. The tricky part for me is that the date is a range that
> spans either 2 or 3 days. I want the web page to dynamically populate
this
> information based on a query. The query will look something like this:
> my
> SELECT 'A.Title'
> FROM `phpCalendar_Daily` AS 'B'
> JOIN 'phpCalendar_Details' AS 'A' ON 'A.CalendarDetailsID' =
> 'B.CalendarDetailsID'
> WHERE CURDATE( )
> BETWEEN 'B.StartDate' AND 'B.StopDate'
Take out all of those quotes! You're making strings out of everything.
WHERE CURDATE() BETWEEN '
> Is like this i have a field in MySql TIME_STAMP int(11) and he has a time
> stamp value (ex: 1045738710) and i want to make show it like a date format
> in the web. Can anyone help me on this...?
Just SELECT it out and run it through the PHP date() function to format it.
www.php.net/date
> Cum
> I tried the following code but all I get back is "Array". I'm trying to
pass
> a huge array.
You need to serialize the array...
> if( isset( $submit ) )
> {
> echo "array list:";
> print_r( $eList );
> $submit = "";
> }
> else
> {
> $mList = array();
> $mList[0] = "1. hello";
> $mList[1] = "2
> Has anyone found a way to import data through
> ssl into a php script? If I can pull xml formatted
> data through a secure socket it will save some
> major headaches with a problem I need to solve.
>
> $url = file("https://www.mydomain.com";); Would
> be ideal, but it does not work
It does w
> I have a mysql database with a table using one column as a primary key.
> (rowID). On a php page I use a query to list all of the rows of the table
> and have a checkbox beside each row that should be used to check if you
> would like to delete this row. Can someone give me an example using pos
> I appreciate all of the quick replies. I do have globals off. Currently, I
> have the values for each ID being returned in a array Array ( [0] =>
> 101 [1] => 201 ) where 101 and 201 were the id's of the rows I checked. I
> have to say I like the way of doing it that Mathieu has shown using
elp you put it all
together.
---John Holmes...
> - Original Message -----
> From: "1LT John W. Holmes" <[EMAIL PROTECTED]>
> To: "Lewis Watson" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> Sent: Monday, February 24, 2003 10:13 AM
> Subject: Re
> Thanks. The below code returns each ID in an array like so...
> Array ( [0] =>101 [1] => 201 ). Thanks for the help!
> Lewis
>
> $teacherID = $_POST[teacherID];
> $deleteID = $_POST[deleteID];
>
> if(isset($delete_teacher)) {
> This is where I should loop through checking for the chosen
Are you sure $deleteID is an array at the
> > point you call implode()? Are you sure it's available in the current
> > scope at the point you call implode()?
> >
> > ---John W. Holmes...
> >
> > PHP Architect - A monthly magazine for PHP Professionals. Get
> How would I store an array in the database? I want to store 2 things.
> One array of shirt sizes and one array of which holds other arrays.
$safe = addslashes(serialize($array));
and store $safe into a text column. Use
$array = unserialize($database_data);
to get the array back.
---John H
> > How would I store an array in the database? I want to store 2 things.
> > One array of shirt sizes and one array of which holds other arrays.
[snip]
> $query = "INSERT INTO table
> ( field1, field2 )
> VALUES
> ( \"" . serialize( $singleDimA
> A client of mine, a rail car storage company, has asked that I create a
> PHP/MySQL application in which they will maintain and track rail cars. I
am
> having a bit of trouble however working through one of thier requirements.
> They need to know in what position the rail car is on each track. Fo
> I have a MySQL column that was set to date.
>
> In my PHP page, I have a form and a field called 'Sch_StartDate'. I'm
> having difficultes understanding how to write to the date column in MySQL.
> If I send 03/04/02for March 4, 2002, the value that gets stored in the
> MySQL database is 2003
> I am looking for a way to take a date stored in a mysql database... and
find
> out the date seven days later.
>
> how would i do this?!
too easy...
SELECT date_column + INTERVAL 7 DAY FROM your_table ...
---John Holmes...
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, vi
1 - 100 of 105 matches
Mail list logo