Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > MySQL
|
MySQL General discussion about the MySQL database.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the MySQL section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 15th, 2004, 04:49 PM
Authorized User
 
Join Date: Apr 2004
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I really don't know what .edit. and .Show. I got it off this web site. You can check it out if you want. http://tutorials.dreamincode.net/question.php?qstId=21
It made my page run.

 
Old April 15th, 2004, 04:59 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Fine right from the beginning you have been giving me some useful data in every post to get closer to the solution, but not all that I asked.

Hope you have given me only the sample data for AddTable1, but no details on AddTable2. Probably, you the second set of Data is what you mean as AddTable2, then I am afraid, it is not related data what say in your post.

This is what I would say is related data.

Student
SId Name
1 Vijay
2 Alex

Department
DId Name
1 Cardio
2 Ortho

Exam
ExId SId DId Marks
1 1 1 90
2 1 2 97
3 2 1 99
4 2 2 98

Here the relation is that There is a common key field in the Third table, compared to that with the other 2 tables. That is why I was asking for the same in my previous post. But herewith I assume I have got only details about AddTable1.

Cheers!

-Vijay G
 
Old April 15th, 2004, 05:10 PM
Authorized User
 
Join Date: Apr 2004
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default

ohh, well yes number 1 and 2 are 2 different tables. I thought they where related because they both contain Id and Name. I don't use primary keys anymore because indexes can relate too. But yes numbers 1 and 2 are two different tables that I have tried to relate. If these tables don't relate, how would you surpose I relate those fields in those two tables? Also, explain how I can get my scheme to work. Because, at my internship I have no suport because of the lack of staff. If you can, please help me if you can, thank you.

 
Old April 15th, 2004, 05:15 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

As you said you have taken that from the website, you have not modified it properly as you wanted it to work.

This is why I have been asking you, what it means.

for example: this was extracted from the URL you gave in your previous post.

Here in this line of code, it means that,
<a href='edit.php?id=".$content[id]."&action=edit'>Edit movie</a>

EDIT Movie will be displayed as a link, on clicking it it would take you to

edit.php?id=10&action=edit

Where Querystrings are id=10 and action=edit.

when you request for the querystring values, You can take the Id's value, in this case 10, and query the database based on Id=10 and get the values to be displayed in a FORM, which can be edited and Saved. The other querystring

Action=Edit

is used to check if the action is edit, and act up on it based on its action value. If it is "delete" then delete the row and so on...

But when you modified it, you have just given it as .Show. and .edit.

Actually, when you use "." it is called contactenation operator, used to concatenate strings and values of variables.
Variables are prefixed with $

I Strongly suggest you to go through the PHP manual and then take code from the websites, and modify it as you would want it. But if you try to learn it this way, you would never get help from people here, as it is a forum that guides you in solving the problem, where it does not teach/spoon feed anyone. So please do have some idea in what you are trying to do syntactically.

http://www.php.net - PHP manual website.

Please do not mistake me the way I replied you. I really didnot want to hurt you, as I always wanted to to help you but atlast came to know that you have taken code some website and was not clear in your requirement too. Also I saw you posting the same in another thread here.;)

No one knows everything. Every step is a learning.
All the best.

Cheers,

-Vijay G
 
Old April 15th, 2004, 05:20 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Alex,

I really wanted to help you learn. Let us not do this here, was anyone who is subscribed to this would get all our posts and might get annoyed as this is a forum where once can post the problem and get it solved and learn something new. I cannot teach you all the basics here. So I would suggest you to mail me to my personal e-mail id, if you dont mind.

[email protected]

Let me see how I can help you out in your requirement.

-Vijay G
 
Old April 15th, 2004, 05:28 PM
Authorized User
 
Join Date: Apr 2004
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Well, actually I do know that "." mean concat form c++ and java that I'm taking in school. I thought that the way they had the that string of code set up it would work with what I'm trying to do. I do syntax alittle. However, I'm try to get use the while loop to increment the data shown as it is inputted in my sql database. When it shows each row, I want the interface to be smart enough to trigger other specified information throughout the database. If you could show me how to do that it would help me out tremendously.






Similar Threads
Thread Thread Starter Forum Replies Last Post
SELECT VARIABLE Number of columns drani Oracle 4 September 21st, 2008 01:12 AM
passing javascript variable in xsl:value-of select eruditionist XSLT 2 September 19th, 2008 05:23 PM
Using variable as fieldname in SELECT statement elygp SQL Server 2000 3 April 26th, 2007 10:14 AM
Using a Variable in Select Into anubhav.kumar SQL Server 2000 2 May 26th, 2005 11:02 AM
Setting a variable using Select Case Adam ASP.NET 1.0 and 1.1 Basics 2 September 4th, 2004 02:09 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.