Book Recommendation

2006-11-27 Thread Nicholas Vettese
I am looking for a book that will help me understand PHP/MySQL, and the
way that they work together.  My biggest problem is multi-valued
selections, and INSERTING them into the database.  A book with great
examples like that would be a huge help.  Also, any websites that could
do the same would be great too.
 
Thanks,
nick


Problems Updating Database

2006-09-06 Thread Nicholas Vettese
I have a registration script that inserts data into the database, and
then emails you an activation code to activate your account.  The
problem is that when I click on the link in the email, the account does
not get updated.  The portion of the script that has a problem is this:
 
$query = UPDATE users SET active=NULL WHERE user_id=$x AND active=' .
escape_data($y) . ' LIMIT 1;  
$result = mysql_query ($query) or trigger_error(Query: $query\nbr
/MySQL Error:  . mysql_error());
 
I do not believe this is a PHP problem because the error states that it
is most likely a MySQL error.  If anyone can see the problem, can you
please let me know what it is.  I have been looking at this for about
three days now, and I can't figure it out.  
 
The registration page does update the DB (MySQL 3.24.49), but the
activation page does not.
 
Thank you,
Nick


RE: Problems Updating Database

2006-09-06 Thread Nicholas Vettese
 $x and $y work perfectly, and I believe the problem is the trigger
function.  Thanks to everyone who helped, and as soon as I get a chance
to update and fix, I will try it.  

Thanks,
Nick 

-Original Message-
From: Miles Thompson [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, September 06, 2006 9:15 AM
To: mysql@lists.mysql.com
Subject: Re: Problems Updating Database

At 08:22 AM 9/6/2006, Nicholas Vettese wrote:

I have a registration script that inserts data into the database, and 
then emails you an activation code to activate your account.  The 
problem is that when I click on the link in the email, the account does

not get updated.  The portion of the script that has a problem is this:

$query = UPDATE users SET active=NULL WHERE user_id=$x AND active=' .
escape_data($y) . ' LIMIT 1;
$result = mysql_query ($query) or trigger_error(Query: $query\nbr 
/MySQL Error:  . mysql_error());

I do not believe this is a PHP problem because the error states that it

is most likely a MySQL error.  If anyone can see the problem, can you 
please let me know what it is.  I have been looking at this for about 
three days now, and I can't figure it out.

The registration page does update the DB (MySQL 3.24.49), but the 
activation page does not.

Thank you,
Nick

Echo $query; test for existence of $x and $y.

Are you sure you need trigger_error()? Why not just use the built-in
error handling?
In any case, what error message do you get?

HTH - Miles 


--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.405 / Virus Database: 268.11.7/438 - Release Date: 9/5/2006



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:
http://lists.mysql.com/[EMAIL PROTECTED]






--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Testing Email

2006-08-25 Thread Nicholas Vettese
I have been having problems with my email, and I wanted to test to this
list.

 

Thanks,

nick



RE: Testing Email

2006-08-25 Thread Nicholas Vettese
Who knew this list had so many funny people.  And I came here for the
serious folks.  Take me off this list!  ;)

Thanks for all the help peoples

-Original Message-
From: Chris Knipe [mailto:[EMAIL PROTECTED] 
Sent: Friday, August 25, 2006 10:46 AM
To: mysql@lists.mysql.com
Subject: Re: Testing Email

INSERT INTO a VALUES (NOW()) ?


Regards,
Chris.

- Original Message - 
From: Renato Golin [EMAIL PROTECTED]
To: Nicholas Vettese [EMAIL PROTECTED]
Cc: mysql@lists.mysql.com
Sent: Friday, August 25, 2006 4:31 PM
Subject: Re: Testing Email


 Nicholas Vettese wrote:
 I have been having problems with my email, and I wanted to test to
this
 list.

 Will let you know when I receive it...

 --renato

 -- 
 MySQL General Mailing List
 For list archives: http://lists.mysql.com/mysql
 To unsubscribe:
http://lists.mysql.com/[EMAIL PROTECTED]

 


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:
http://lists.mysql.com/[EMAIL PROTECTED]






--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: cell colors PHP/MySQL

2006-08-09 Thread Nicholas Vettese
Wouldn't using a 'switch' statement work better?  Just please do not ask me 
to show an example.  :)


- Original Message - 
From: Chris White [EMAIL PROTECTED]

To: mysql@lists.mysql.com
Sent: Wednesday, August 09, 2006 3:30 PM
Subject: Re: cell colors PHP/MySQL



On Wednesday 09 August 2006 12:24 pm, Brian E Boothe wrote:

i'm needing assistance in table Cell color thru MySQL
 i have a project were im listing a projects in a table  either Complete
/ Active / Pending /  now im needing these refrances cells to change
Color whenver its lists them out on a page,
  [Complete] =  green[Active] = Blue[Pending] = yellow
Can someone Give me refrences or Code in PHP to how to accomplish this


Well, I'd just have 3 css classes: complete, active, and pending.  When 
it's
outputting these cells, have the cells use the class attribute, setting 
them

to the respective values.


thanks


--
Chris White
PHP Programmer/DBanjo
Interfuel

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: 
http://lists.mysql.com/[EMAIL PROTECTED]





--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Alter Problem

2006-08-03 Thread Nicholas Vettese
I am working on a script that looks at the MySQL Table, checks to see if there 
are any matches, and if there are, alter the table to add the requested 
information.  Here is the code I am using:

script
$query = ALTER profile (acct_type, username, firstname, lastname, email, 
addr1, city, state, zip, nude, artistic, model_look, about_you, why_model, 
genre) VALUES ('$at', '$un', '$fn', '$ln', '$e', '$ad1', '$c', '$st', '$zc', 
'$nd', '$art', '$ml', '$ay', '$wm', '$g');
/script

What am I doing wrong?  The error comes back saying that this is where the 
problem is, and I have changed it from UPDATE to ALTER because I was trying to 
get the information to be added to the table of an already registered user.

Nick

Re: Alter Problem

2006-08-03 Thread Nicholas Vettese

A quick question.  I do not have `userid` setup in my script to update my
table.  Right now it is setup like this: $query = SELECT userid FROM
profile WHERE username = '$un';

So when I go to change my usernamre, it creates a new row in the table with
all the info.  What would be the best way to use `userid`?

Thanks,
nick

- Original Message - 
From: Miles Thompson [EMAIL PROTECTED]

To: mysql@lists.mysql.com
Sent: Thursday, August 03, 2006 10:42 AM
Subject: Re: Alter Problem



At 11:12 AM 8/3/2006, Nicholas Vettese wrote:

I am working on a script that looks at the MySQL Table, checks to see if 
there are any matches, and if there are, alter the table to add the 
requested information.  Here is the code I am using:


script
$query = ALTER profile (acct_type, username, firstname, lastname, email, 
addr1, city, state, zip, nude, artistic, model_look, about_you, why_model, 
genre) VALUES ('$at', '$un', '$fn', '$ln', '$e', '$ad1', '$c', '$st', 
'$zc', '$nd', '$art', '$ml', '$ay', '$wm', '$g');

/script

What am I doing wrong?  The error comes back saying that this is where the 
problem is, and I have changed it from UPDATE to ALTER because I was 
trying to get the information to be added to the table of an already 
registered user.


Nick


Nick,

Just to add to what Peter said, and so you do not inadvertently shoot 
yourself in the foot, have a look at some tutorials, like this one:

http://www.php-mysql-tutorial.com/
which appears to be divided into sections appropriate to operations on the 
database.


Then check the MySQL docs for specifics on SELECT, INSERT and UPDATE.

Fortunately your ALTER TABLE statement was incorrect, otherwise you would 
have destroyed the table and lost all of your data.


Regards - Miles Thompson

--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.1.394 / Virus Database: 268.10.5/406 - Release Date: 8/2/2006



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: 
http://lists.mysql.com/[EMAIL PROTECTED]





--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Checkboxes

2006-07-26 Thread Nicholas Vettese
I am trying to allow a user to use checkboxes for multiple selections, and I am 
trying to get the database to record the choices made by the user.  I am using 
a VARCHAR(250), but I am guessing that may be wrong.  Also, other than adding a 
[] to the end of the 'name' (e.g. input type=checkbox name=mod_type[] 
value=alternative /Alternativebr /), what do I need to do?

I hope I am asking this question correctly.  If not, please feel free to flame 
me.

Nick



Images Table

2006-07-20 Thread Nicholas Vettese
I am looking to create a database that holds the location of images on my 
server.  I was wondering if anyone could help me understand if I am doing it 
correctly, and if I either need to add, change or remove something from the 
current table code.

img_idINTNOT NULL auto_increment PRIMARY KEY,
user_id   INTNOT NULL,
location  VARCHAR(255) NOT NULL,
imgtype  VARCHAR(20) NOT NULL,
img_tag  VARCHAR(50) NOT NULL,
img_rate VARCHAR(20) NOT NULL,
img_commentsVARCHAR(50) NOT NULL,
KEY (img_id);

Thanks for any help.

nick

File (xls, csv, txt) to MySQL

2006-07-10 Thread Nicholas Vettese
If I have a file that is in a spreadsheet format, how can I dump that into a 
MySQL database, using PHP MyAdmin?

Thanks,
Nick

Re: Rekall

2006-07-07 Thread Nicholas Vettese
If you are using an apt-based system, type 'apt-cache search mysql'  That 
should bring up some programs you can install from.


nick



- Original Message - 
From: Daniel da Veiga [EMAIL PROTECTED]

To: mysql@lists.mysql.com
Sent: Friday, July 07, 2006 1:12 PM
Subject: Re: Rekall



On 7/7/06, Timothy Murphy [EMAIL PROTECTED] wrote:

I've used the KDE program rekall to a small extent in the past,
in order to set up and populate MySQL tables on a remote machine.
It has recently been seg-faulting:

[EMAIL PROTECTED] ~]$ rekall
KBLocation::setCacheSize: set to 0MB
Segmentation fault

In any case, I didn't find it very easy to use.
I wonder if anyone can suggest an alternative -
a GUI Linux application
which allows data to be entered in an SQL table.
My preference would be for Python and KDE,
but those aren't essential.



Have you tried MySQL Administrator and Query Browser?

--
Daniel da Veiga
Computer Operator - RS - Brazil
-BEGIN GEEK CODE BLOCK-
Version: 3.1
GCM/IT/P/O d-? s:- a? C++$ UBLA++ P+ L++ E--- W+++$ N o+ K- w O M- V-
PS PE Y PGP- t+ 5 X+++ R+* tv b+ DI+++ D+ G+ e h+ r+ y++
--END GEEK CODE BLOCK--

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: 
http://lists.mysql.com/[EMAIL PROTECTED]





--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Insertion Problem

2006-06-28 Thread Nicholas Vettese
Hello all,
  I am trying to get this script to INSERT a couple of records into my DB, but 
I am getting these errors.  I know the second warning has nothing to do with 
MySQL, so I will work on figuring out that portion later today.


Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result 
resource in c:\program files\easyphp1-8\www\test\username.php on line 7
The following users on yoursystem are:

Warning: Invalid argument supplied for foreach() in c:\program 
files\easyphp1-8\www\test\username.php on line 9


I am not sure why this is is happening, but my PHP script goes like this...

script
?php

if (isset($_POST['submit'])) {
  require_once ('mysql_connect-local.php'); // Connect to the database.
  $query = SELECT * FROM users ORDER BY username ASC;
  $result = @mysql_query($query);
  $row = mysql_fetch_array($result, MYSQL_NUM);
  echo The following users on yoursystem are:br /;
  foreach ($_POST['users'] AS $users) echo 
tabletrtd$user_id/tdtd$username/tdtd$firstname/tdtd$lastname/tdtd$email/td/tr/table;
}

?
/script

Any help is appreciated.

Nick


Multiple Entries

2006-06-26 Thread Nicholas Vettese
If I have a multiple choice on a form and want to store that in my DB, then how 
should I set up my table?  I have been reading up on these, but everyone seems 
to have a different opinion on how to accomplish this task.  What I am looking 
to do give the user a few options to check when submitting a form.  


select name=sports multiple id=sport_type
option value=baseballBaseball/option
option value=footballFootball/option
option value=soccerSoccer/option
option value=hockeyHockey/option
/select

Would my table look like this:


CREATE TABLE sports (
sports_id int(11) not null auto_incremement,
sport_name text not null,
primary key (sports_id)
);

INSERT INTO `tbl_options` VALUES (1, 'Baseball');
INSERT INTO `tbl_options` VALUES (2, 'Football');
INSERT INTO `tbl_options` VALUES (3, 'Soccer');
INSERT INTO `tbl_options` VALUES (4, 'Hockey');
...

Would using text as the way to store make it easier to retrieve the data in a 
manner that would be readable on a web page?

Thanks,
Nick

New to the group

2006-06-22 Thread Nicholas Vettese
Hello,
  My name is Nick, and I am a new MySQL user.  My hope is not to become a PITA, 
so I will make sure that any question is straight and to the point with the 
information needed to answer the question.  

  My skill in MySQL is pretty low, and I am looking to build a website for 
myself that will take information and save it to a database.  At this time, I 
have a login, registration, change/lost password functionality working from a 
book that I read, but I am looking to expand my knowledge into more robust 
site.  I am not looking to become the master programmer, just someone with 
enough knowledge and skill to accomplish his goals.

Thanks,
Nick