×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

PHP/MySQL query is simple, but not returning a value. Any advice?
2

PHP/MySQL query is simple, but not returning a value. Any advice?

PHP/MySQL query is simple, but not returning a value. Any advice?

(OP)
Need some help if someone would be kind enough to offer. I'm modifying the edit view in JEvents All I'm trying to do is lookup the eventdetail_id from a table. I have gone through countless permutations of this code and every time it returns as if there is not a matching record (array, etc). I know there is a matching record, and the eventdetail_id should return 35.

CODE

//fyi: Values already assigned are: $rp_id=3516 and $evtID=3516

$detailid = "SELECT eventdetail_id FROM jos_jevents_repetition WHERE rp_id =".$evtID;
$db->setQuery( $detailid );
$jbIds= $db->loadObjectList();
$jbId=mysql_fetch_array($jbIds)
I'm not a PHP expert so if something does not follow my limited expectations, I try stuff and hope to find the answer. I'm out of things to try. Unfortunately, the task at hand doesn't always respect your skill level.

Any help is appreciated

Jevents: 1.5.4
Database Version: 5.1.36-community-log
Database Collation: utf8_general_ci
PHP Version: 5.2.5
Web Server: Apache/2.2.11 (Win32) PHP/5.2.5
Web Server to PHP interface: apache2handler
Joomla! Version: Joomla! 1.5.15 Stable

RE: PHP/MySQL query is simple, but not returning a value. Any advice?

If you are using Joomla's functionality, then this may not be what you are looking for.  But if you are using PHP directly, then the function you need is mysql_query.
I would recommend looking at the documentation here:
http://us.php.net/manual/en/function.mysql-query.php

Hope this helps.

RE: PHP/MySQL query is simple, but not returning a value. Any advice?

The first thing I'd do is print out the value built up in $detailid, just to make sure it is what you think it is. The second thing is to run that query in phpmyadmin (or similar) to make sure it returns what you think it returns.

Then you can worry about the rest of it.

-- Chris Hunt
Webmaster & Tragedian
Extra Connections Ltd

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close