[PHP] easy mysql question

2001-07-08 Thread [EMAIL PROTECTED]

Since I first made the tables for my site I've had to modify them quite a
bit. I always keep a copy of the commands I used to make the tables in case
I need to move a site. Is there a way to ask mysql to list the create table
commands?


Susan


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] easy mysql question

2001-07-08 Thread Ben Bleything

Do you mean to output the current structure of the table?

Check out http://www.mysql.com/doc/m/y/mysqldump.html.  Mysqldump will
do that for you... If you mean a syntax reference, check www.mysql.com.
If you didn't mean either of those things, Sorry =

Ben

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] 
Sent: Sunday, July 08, 2001 7:49 PM
To: [EMAIL PROTECTED]
Subject: [PHP] easy mysql question

Since I first made the tables for my site I've had to modify them quite
a
bit. I always keep a copy of the commands I used to make the tables in
case
I need to move a site. Is there a way to ask mysql to list the create
table
commands?


Susan


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] easy mysql question

2001-07-08 Thread Mark Charette

On Sunday 08 July 2001 21:48, [EMAIL PROTECTED] wrote:
 Since I first made the tables for my site I've had to modify them quite a
 bit. I always keep a copy of the commands I used to make the tables in case
 I need to move a site. Is there a way to ask mysql to list the create table
 commands?

mysqldump -d

Mark C.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] easy mysql question

2001-07-08 Thread Chris Kay


if you use phpMyAdmin you can dump the structure and data to a file and use
phpMyAdmin to place it on a new machine

At 10:48 PM 7/8/01 -0400, [EMAIL PROTECTED] wrote:
Since I first made the tables for my site I've had to modify them quite a
bit. I always keep a copy of the commands I used to make the tables in case
I need to move a site. Is there a way to ask mysql to list the create table
commands?


Susan


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



 Chris Kay - Tech Support - IDEAL Internet
email: [EMAIL PROTECTED] phone: +61 2 4628  fax: +61 2 4628 8890



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] easy mysql question

2001-07-08 Thread Don Read


On 09-Jul-01 [EMAIL PROTECTED] wrote:
 Since I first made the tables for my site I've had to modify them quite a
 bit. I always keep a copy of the commands I used to make the tables in case
 I need to move a site. Is there a way to ask mysql to list the create table
 commands?
 

$ mysqldump -d [--add-drop-table database [table, ...]

Regards,
-- 
Don Read   [EMAIL PROTECTED]
-- It's always darkest before the dawn. So if you are going to 
   steal the neighbor's newspaper, that's the time to do it.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Easy MySQL question

2001-01-11 Thread Nicolas Windpassinger - Sun



Joseph,
here it is:

Number of manpages in db: 
?php $sql = "SELECT count(*) FROM manpagetool.manpages";
$result= mysql_query($sql); 
$number = mysql_fetch_array($result);
echo $number["count(*)"];
?

hope that's what you were looking for,

Nicolas.


"Paulson, Joseph V. \"Jay\"" wrote:
 
 Hello everyone--
 I've got a easy question that I can't seem to answer for myself.  I'm
 running a query in MySQL and want to know how many entries are in a table
 and then echo that out onto a page.  I thought this would be easy but I
 don't know why it's not working.  Anyway, here's what I am doing:
 
 (open db connection)
 
 $query = "SELECT count(*) FROM Movie";
 $result = mysql_query($sql, $dbLink);
 $myrow = mysql_result($result);
 echo $myrow;
 
 (close db connection)
 
 I know this is wrong but I don't know how to get the results to echo out to
 the page.
 
 Thanks,
 Jay
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Easy MySQL question

2001-01-11 Thread Paulson, Joseph V. \Jay\

Hello everyone--
I've got a easy question that I can't seem to answer for myself.  I'm
running a query in MySQL and want to know how many entries are in a table
and then echo that out onto a page.  I thought this would be easy but I
don't know why it's not working.  Anyway, here's what I am doing:

(open db connection)

$query = "SELECT count(*) FROM Movie";
$result = mysql_query($sql, $dbLink);
$myrow = mysql_result($result);
echo $myrow;

(close db connection)

I know this is wrong but I don't know how to get the results to echo out to
the page.

Thanks,
Jay

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]