How to Join Member's Area Private Library Search Today's Topics p Login
Main Forums Discussion Tech Talk Mature Content Archives
   Nav Win
 Tech Talk
 Geek Stuff
 PHP and Mysql
 1 2 3 4 5 6 7 8 9 10
Follow us on Facebook

 Moderated by: Christopher   (Admins )

 
User Options
Format for Better Printing EMail to a Friend Not Available
Admin Print Send ECard
Passions in Poetry

PHP and Mysql

 Post A Reply Post New Topic   Go to the Next Oldest/Previous Topic Return to Topic Page Go to the Next Newest Topic 
Parker
Member Elite
since 01-06-2000
Posts 3135
... the old black rum


0 posted 09-28-2004 01:12 PM       View Profile for Parker   Email Parker   Edit/Delete Message      Find Poems   Click to visit Parker's Home Page   View IP for Parker

I was directing this to Ron, but anybodys input is goo.
I'm just delving into this territory of php/mysql
anybody got an opinion on it, good or bad, directions to take etc.

Parker
Ron
Administrator
Member Rara Avis
since 05-19-99
Posts 9708
Michigan, US


1 posted 09-28-2004 05:31 PM       View Profile for Ron   Email Ron   Edit/Delete Message      Find Poems   Click to visit Ron's Home Page   View IP for Ron

It's all good.

My only warning would be to learn PHP first, becoming reasonably comfortable in that paradigm, before trying to also learn SQL. Download some programs that interest you from one of the many resources available, then change them to do something a bit differently. As you modify someone else's code, you'll likely learn a lot of different ways to do things in PHP, and most importantly, you'll start to "think" in code. When you later tackle the complexities of database design and SQL, it'll seem less daunting than it will if you try to learn both at the same time.

Good luck!
Parker
Member Elite
since 01-06-2000
Posts 3135
... the old black rum


2 posted 09-29-2004 01:18 AM       View Profile for Parker   Email Parker   Edit/Delete Message      Find Poems   Click to visit Parker's Home Page   View IP for Parker

Ron, are you any good at this php language?

James
Ron
Administrator
Member Rara Avis
since 05-19-99
Posts 9708
Michigan, US


3 posted 09-29-2004 07:46 AM       View Profile for Ron   Email Ron   Edit/Delete Message      Find Poems   Click to visit Ron's Home Page   View IP for Ron

The new forums software is being written in PHP (mostly), so let's hope I don't suck too bad.

Parker
Member Elite
since 01-06-2000
Posts 3135
... the old black rum


4 posted 09-29-2004 12:13 PM       View Profile for Parker   Email Parker   Edit/Delete Message      Find Poems   Click to visit Parker's Home Page   View IP for Parker

Ron,

I hope you don't mind me picking your brain now and again, since you probably have alot of experience on this stuff. I've got a query i'm trying to perform that just wont work. Simple, I have a mysql database with say two tables, ones a member list and the other is a profile table. What i'm trying to do is only display the members in the member list that don't have a profile record in the profile table. Its no problem display members with a profile record in the profile table but display members without a matching record I can't get to work. It seems like it should be a short syntax statement. I tried using a join a few times but my skill in sql is not great. Does this sound simple?

Parker
Ron
Administrator
Member Rara Avis
since 05-19-99
Posts 9708
Michigan, US


5 posted 09-30-2004 05:27 AM       View Profile for Ron   Email Ron   Edit/Delete Message      Find Poems   Click to visit Ron's Home Page   View IP for Ron

SELECT Field1, Field2, Field3
FROM Table1
LEFT JOIN Table2
ON Table1.CommonField = Table2.CommonField
WHERE Table2.CommonField is null;
Parker
Member Elite
since 01-06-2000
Posts 3135
... the old black rum


6 posted 09-30-2004 02:38 PM       View Profile for Parker   Email Parker   Edit/Delete Message      Find Poems   Click to visit Parker's Home Page   View IP for Parker

Hi Ron, I'll try that out tonight.
does the statement
WHERE Table2.CommonField is null;
assume that there is not even and entry in that table? Anyway I guess i'll know when I try it. Thanks for the input

Parker

Parker
Member Elite
since 01-06-2000
Posts 3135
... the old black rum


7 posted 10-04-2004 03:14 AM       View Profile for Parker   Email Parker   Edit/Delete Message      Find Poems   Click to visit Parker's Home Page   View IP for Parker

Ron, this is what I tried... not sure whats wrong but it doesn't produce any results. Does this look like it should work.

$r9=mysql_query("select id from members, left join profile, on members.id = profile.id where profile.id is null");
$nummems = mysql_num_rows($r9);
echo "";


James
Ron
Administrator
Member Rara Avis
since 05-19-99
Posts 9708
Michigan, US


8 posted 10-04-2004 10:17 AM       View Profile for Ron   Email Ron   Edit/Delete Message      Find Poems   Click to visit Ron's Home Page   View IP for Ron

You have a smattering of commas in there, James, that are not correct (and weren't in my example). Try it without inserting anything extra?
Parker
Member Elite
since 01-06-2000
Posts 3135
... the old black rum


9 posted 10-05-2004 02:05 AM       View Profile for Parker   Email Parker   Edit/Delete Message      Find Poems   Click to visit Parker's Home Page   View IP for Parker

Ron,

Here's what I put in... still no success.

$r9=mysql_query("Select id from members LEFT JOIN profile ON members.id = profile.id WHERE profile.id is null");
$nummems = mysql_num_rows($r9);
echo "";
Parker
Member Elite
since 01-06-2000
Posts 3135
... the old black rum


10 posted 10-05-2004 11:47 PM       View Profile for Parker   Email Parker   Edit/Delete Message      Find Poems   Click to visit Parker's Home Page   View IP for Parker

Well got it to work with this little variation... don't know why the others didn't work... thats code for you. Too picky.

$r9=mysql_query("Select members.id from members LEFT JOIN profile ON members.id = profile.id WHERE profile.id is null");
$nummems = mysql_num_rows($r9);
echo "";

Thanks for all your help Ron...

James
Parker will be notified of replies
 Post A Reply Post New Topic   Go to the Next Oldest/Previous Topic Return to Topic Page Go to the Next Newest Topic 
All times are ET (US) Top
  User Options
>> Tech Talk >> Geek Stuff >> PHP and Mysql Format for Better Printing EMail to a Friend Not Available
Print Send ECard

 

pipTalk Home Page | Main Poetry Forums

How to Join | Member's Area / Help | Private Library | Search | Contact Us | Today's Topics | Login
Discussion | Tech Talk | Archives | Sanctuary



© Passions in Poetry and netpoets.com 1998-2013
All Poetry and Prose is copyrighted by the individual authors