Re: [PHP-DB] select from two tables

2002-08-03 Thread Caleb Walker

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

I did not look at the code very much but if you want to select from 2 tables 
your sql statement is like this:

select a.col1,b.col1 from table1 a,table2 b where a.column=b.column  
column='value';
I think that if this is what you are looking for this should help...

Caleb

On Saturday 27 July 2002 6:17 am, Barry Rumsey wrote:
 Ok I tired this but it did not help, but thank you.

 -Original Message-
 From: Herman Verkade [mailto:[EMAIL PROTECTED]]
 Sent: Sunday, 28 July 2002 1:18 a.m.
 To: 'Barry Rumsey'
 Cc: [EMAIL PROTECTED]
 Subject: RE: [PHP-DB] select from two tables

 Well, I'm just a beginner myself, but I would say that:
  echoi by ; echo ($albumby[xoops_artist.artist]); echoibr;

 should at least be:
  echoi by ; echo ($album[xoops_artist.artist]); echoibr;

 or even:
  echoi by ; echo ($album[artist]); echoibr;

 Hope this helps,

 Herman

- -- 
Get my GnuPG public key http://www.cwalk.org/pgp_info.html
See complete mail headers for more information
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE9TGBF6k6xsUuSNSsRAnQmAJ9TT6pB7n8WaqVCHixPobIcTYLEXACfcKFz
ce+/GnVVNQvQTansb5feuPg=
=Jhay
-END PGP SIGNATURE-

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] MySQL problem

2002-02-21 Thread Caleb Walker

I keep on getting this error statement:
Warning: Supplied argument is not a valid MySQL result resource in 
/usr/local/www/data/phone/insert2.php on line 10
2

Can someone tell me what is wrong with the code below, I just cannot figure 
it out... Thank you very much in advance.  I am using php4.

html
?
session_start();
include(info.inc.php);

mysql_connect($host,$user,$pass) || die(mysql_error());
mysql_select_db($db) || die(mysql_error());


$q = mysql_query(SELECT FName, LName FROM user_info WHERE (FName='$FName'  
LName='$LName')) || die(1);
$view = mysql_fetch_array($q) || die(2);
?

?=$view[0]?
/html

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] problem with mysql_data_seek() fuction

2001-08-15 Thread Caleb Walker

br
bWarning/b:  Offset 0 is invalid for MySQL result index 2 in 
b/usr/local/www/data/football/front/index2.php/b on line b20/bbr

When using mysql_data_seek($result,0) why do I get the above error in the 
source code of the html that is produced?

Another side point is that this does not display on my webpage for some 
reason.  If you look quickly at the page you would think that everything went 
good but if you look at the source code I get this error at the very top 
before the html tag.

-- 
PHP Database 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-DB] start over on database read inorder to read from the beggining again

2001-08-13 Thread Caleb Walker

How can I run through a database like I am trying to do here?  It seems like 
at the end of the first I need to start over in order to start reading from 
the beggining of the database on the second.
I hope that I hace explained my problem well if not please reply with your 
questions.  Thank you in advance.

Caleb
!--Snip--
$connect = mysql_connect($host,$user,$pass) OR (die(mysql_error));
$selectdb = mysql_select_db($db) OR (die(mysql_error));
$result = mysql_query(SELECT * FROM teams where week='$list' ORDER BY date);
while($view = mysql_fetch_row($result))
{
code;
}
more code;
and html
while($view = mysql_fetch_row($result))
{
code;
}
!--Snip--

-- 
PHP Database 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-DB] Retrieving Rows - Can I Change The Order?

2001-07-27 Thread Caleb Walker


 Now then, I have changed a column in the table, and the only way I found to
 change a data type is to delete the offending column and then add it again.

 When I do the select now the new column, which was at $row[3] is now always
 $row[39]. I don't mind this, because I know where it is, but is there any
 way I can make it appear at $row[3] again? I'm sure you can imagine when
 there are quite a few pages using this code it's easier to reorder the
 columns in the select than to change all my if() codes!

Maybe I am missing what you are trying to do but it sounds like you are just 
trying to sort your columns.  If that is what you are asking then why dont 
you do your query like this:
select * from $table where $column = '$value' ORDER BY $column
I hope this is what you were asking and that is helps you out.


 By the way, I know I can be explicit by SELECTing each column by name, but
 I'ds rather use a SELECT * fror this partucular instance.

 Any ideas? Or am I just being lazy (it's been a long night after all!)?


 TIA


 Dave

-- 
PHP Database 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-DB] line breaks in mySQL text fields

2001-07-25 Thread Caleb Walker

On Monday 23 July 2001 11:16 am, kmurrah wrote:
 How do I add new line characters to a text field in mySQL ?

 i.e. i need to manually insert returns into my text ...

 thanks in advance,

 KennM

Does the \n not work?  I dont have time to try it write now but did you try 
it?

-- 
PHP Database 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-DB] 'htaccess method : how to modify passwords from PHP scripts ?

2001-07-25 Thread Caleb Walker

On Tuesday 24 July 2001 10:22 am, JD Daniels wrote:
 There is a fantastic class that takes care of writing .ht* files... look
 here:

 http://phpclasses.upperdesign.com/

Couldnt find anything on writing .ht* files.  Are you sure?

-- 
PHP Database 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]