| We hope you enjoy your visit. You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free. Join our community! If you're already a member please log in to your account to access all of our features: |
| SQL...; Confuzzled | |
|---|---|
| Tweet Topic Started: Jun 10 2005, 03:46 PM (308 Views) | |
| JoeC | Jun 10 2005, 03:46 PM Post #1 |
|
Euch! IE tastes horrible!
![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
OK, I have an insert script I'm trying to set up, to insert a record into a database. The PHP is as follows
And a button with:
But, whenever I hit the VIEW TABLE button, I get "Resource id #3" as the only result. Can someone fix this please? :angel: |
![]() |
|
| Seth | Jun 10 2005, 03:51 PM Post #2 |
|
I has a pony
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
A $result is a resource link. You need to plug that into mysql_fetch_array() to grab the actual data. |
![]() |
|
| Gornakle | Jun 10 2005, 03:52 PM Post #3 |
|
Member
![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
The mysql_query returns an identifier. You can use this identifier with a function such as mysql_fetch_assoc(). For instance:
echoes all ID's in the table. |
![]() |
|
| JoeC | Jun 10 2005, 04:11 PM Post #4 |
|
Euch! IE tastes horrible!
![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
Edit...Now I understand Thanks alot.
|
![]() |
|
| JoeC | Jun 10 2005, 04:48 PM Post #5 |
|
Euch! IE tastes horrible!
![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
Hm. Sorry for the double post, just so people who've read this and may be able to help can see there's a new point. I've now just been playing around trying to get it to put my results into a table...I'm probably doing it wrong, but I got this:
[FILTER] is just a value like pie but obviously, it's data relating to the table, so I don't want people to see it =) The problem is with this that it gives nothing. If I replace the "s in the echo, with 's, I get a parse error. Any help please? Thanks. EDIT: Does it have something to do with RecordAsTable() or is that totally wrong? |
![]() |
|
| Dennis | Jun 10 2005, 05:36 PM Post #6 |
|
Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
Is this an insert or select? The only query is a SELECT. |
![]() |
|
| FearKiller | Jun 10 2005, 05:51 PM Post #7 |
|
www.drewscripts.com
![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
During the while loop your switching to HTML without first ending PHP. Here's one way to do it.
|
![]() |
|
| JoeC | Jun 10 2005, 06:53 PM Post #8 |
|
Euch! IE tastes horrible!
![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
Thankies mucho. All sorted now ![]() Mod/Admin can lock/trash/delete this, I don't need it any more. Thanks to Seth and TheBalrog for helping in varying amounts, and FearKiller and Gornakle for providing answers
|
![]() |
|
| 1 user reading this topic (1 Guest and 0 Anonymous) | |
| « Previous Topic · Technology Chat · Next Topic » |
| Track Topic · E-mail Topic |
11:30 AM Jul 11
|



![]](../../../../0/1/0/p601690/pipright.png)



Thanks alot.

11:30 AM Jul 11