Jump to content

Welcome to Geeks to Go - Register now for FREE

Geeks To Go is a helpful hub, where thousands of volunteer geeks quickly serve friendly answers and support. Check out the forums and get free advice from the experts. Register now to gain access to all of our features, it's FREE and only takes one minute. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more.

Create Account How it Works
Photo

Link 2 tables from MySQL using Perl


  • Please log in to reply

#1
Wren182

Wren182

    New Member

  • Member
  • Pip
  • 4 posts
I'm working with Perl and MySQL to set up databasing for a site. I haven't used this scripting in about 5 years so I'm a little rusty. I'm trying to use a link in one table (through Perl scripting) that will then show the results from another table. For example... For what I'm working on there are 2 tables, one for dispatch info and then a second for dispatch details (more detail about the first table's info). The primary key for the the dispatch info is the dispatch number. I'd like to make it that the dispatch number shows up as a link (on the HTML table displayed on the screen) that can access the more detailed info about that dispatch number on the second table (and display this info in a HTML table for viewing also).

I've attached a Word file below that may expain and show this info better.

Can you please help?? :whistling:

Take care,

Tristina

Attached Files


Edited by Wren182, 21 January 2007 - 03:55 PM.

  • 0

Advertisements


#2
Michael

Michael

    Retired Staff

  • Retired Staff
  • 1,869 posts
I would do something like

<a href="/details.php?number=put the dispatch number here">Details</a>

And the get the variable number and use that to display all the details from the other table.

I can't really say much more as I don't know your code, and use PHP not Perl

Edited by Michael, 22 January 2007 - 02:23 AM.

  • 0

#3
Wren182

Wren182

    New Member

  • Topic Starter
  • Member
  • Pip
  • 4 posts
Hi Michael,

I appreciate you looking into this for me but I am not familiar with PHP. (Sorry) And I'm not sure how this command would tie in the mySQL table?

Tristina
  • 0

#4
Michael

Michael

    Retired Staff

  • Retired Staff
  • 1,869 posts
I meant that to be HTML :whistling: you put the dispatch number in when creating the page. It a links to another page the displays the details based to the dispatch number collected from the url.

I sure this would work in Perl as well as PHP

Is this what you wanted?
  • 0

#5
Wren182

Wren182

    New Member

  • Topic Starter
  • Member
  • Pip
  • 4 posts
Hi Michael (and anyone else reading this),

Okay on your suggestion and a friend of mine I've tried to get the login to work in PHP. Please be patient with me as I have NEVER used PHP and am trying to understand what it is I'm actually doing. :whistling:

I have 2 questions:

1. Could you suggest a good book or site that would help me to understand the PHP better, since I have to do some really intense stuff.

&

2. What am I doing wrong with this script? It's connecting to MySQL and everything, but it keeps telling me the password is wrong. I really need to get this done so I can move on to the other pages.


All info is below. And you can view the problem at www.fr8ship.com/login.php

Thank you for all your helps so far. I really appreciate!

Tristina

Database info (MySQL):

Removed

Script:


  • 0

#6
Michael

Michael

    Retired Staff

  • Retired Staff
  • 1,869 posts
http://www.php.net/manual/en/ PHP manual :whistling:

I can't see any PHP errors on that page, nor do I know the user name or password. I not exactly sure what is going wrong.
  • 0

#7
ScHwErV

ScHwErV

    Member 5k

  • Retired Staff
  • 21,285 posts
  • MVP
I removed the username and password. Seriously, who posts their username and password on an open forum??
  • 0

#8
Michael

Michael

    Retired Staff

  • Retired Staff
  • 1,869 posts

I removed the username and password. Seriously, who posts their username and password on an open forum??

Of course I knew it was you, what other mod/admin runs around in the web forums? :whistling:
  • 0

#9
Wren182

Wren182

    New Member

  • Topic Starter
  • Member
  • Pip
  • 4 posts
I'm sorry, but I was desperate!! I need to have this work done by Monday night and I can't even get the stupid login to work. I went through it with a fine tooth comb and tried to figure out from other sites what I could have done wrong. I can always change my id and password once I get this figured out for security reasons and there is nothing sensitive in there right now until I can get it working.

Can I email someone directly for help with this?

Tristina
  • 0

#10
Michael

Michael

    Retired Staff

  • Retired Staff
  • 1,869 posts
You could PM me?

A great place for quick help is #php in irc.freenode.org that is if you know how to use IRC.
  • 0






Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP