Here's the MySQL query i'm running. It basically pulls data from 2 tables based on some data passed.
Here are things i know.
1. The data passed is passed correctly, and is correct as far as data goes.
2. The sql statements do run, the database connection is solid and works.
3. Other queries work, this however is the first join query im attempting.
4. employee_directory is a regular table, but pcsmgr.mvx_phone_history_io is a table inside the pcsmgr SCHEMA on the database. hence the prefix in the table names.
My guess it that perhaps the fact that my SELECT fields have two periods? maybe i dunno.
pcsmgr.mvx_phone_history_io.extension for example.
Here's the query - please see if you can figure out why the $recordCount returns 0;
Code: <?php
#Check for this branch
$branchid_SQL = $brancharray[$key][0];
#===Find All People That Work for "filenumber" WITHIN EACH BRANCH
$sql_1 = "SELECT employee_directory.filenumber,
employee_directory.phone,
employee_directory.firstname,
employee_directory.lastname,
employee_directory.managerid,
employee_directory.departmentid,
employee_directory.branchid,
pcsmgr.mvx_phone_history_io.extension,
pcsmgr.mvx_phone_history_io.calldate,
pcsmgr.mvx_phone_history_io.calltype,
pcsmgr.mvx_phone_history_io.dur_seconds,
pcsmgr.mvx_phone_history_io.dur_minutes,
pcsmgr.mvx_phone_history_io.dist_pnums,
pcsmgr.mvx_phone_history_io.count_pnums,
pcsmgr.mvx_phone_history_io.dognet_user_id,
pcsmgr.mvx_phone_history_io.callcat
FROM pcsmgr.mvx_phone_history_io, employee_directory
WHERE employee_directory.managerid = '$DT_filenumber' AND
employee_directory.branchid = '$branchid_SQL' AND
employee_directory.filenumber = pcsmgr.mvx_phone_history_io.dognet_user_id";
$go_1 = oci_parse($conn, $sql_1);
oci_execute($go_1);
$result_1 = oci_fetch_assoc($go_1);
$recordCount = oci_num_rows($go_1);
echo $recordCount;
?>
-- NEW
just realised that by removing this line of code from the query
Code: <?php
AND employee_directory.filenumber = pcsmgr.mvx_phone_history_io.dognet_user_id
?>I actually get a result, an inaccurate one but a result none the less. So i guess the next question is whats wrong with that line?
using variables in another page
I have a test database set up on localhost. I have a form that I can type a name into, hit the button and it puts the name into the database and into a list on my page. it works fine. Now, I wanted to
problem getting my contact form working
Yeah I know this is a pretty basic problem, but it's been a while since I've worked with PHP and I'm having a real problem getting it functioning properly. My real issue is the user inputed
UL and LI Add Form
The idea I want here is when the user click on a character name from the drop down select bar at the bottom of the the form under case 1 and hits Add it is supposed to add it as a new LI in the UL
Web Application Recipe
Hi Guys! I am working with the Web Application recipes. I am currently working on the send password page. The page is working, but I sends the same password and username regardless of the email
echo $rows help
Hi all,Hopefully something simple that I don't know!I have this:Code: [Select]<div id="marquee"><?php$query = mysql_query("SELECT stock_id, stock_code, t_val, y_val
INSERT for date range
Hi allI have the following tableCode: [Select] `date` date `day` int(2) `month` int(2) `year` int(4)If I pass a date range in PHP, such asCode: [Select]$datefrom = '2009-02-20';$dateto =
Track downloads' status
Hello,I need to make somehow, some system, to track whether downloads are completed or failed. I tried to make this via php.Tried to limit the connection speed for smaller downloads (to have the time
PHP Script runs on CLI but not through web browser
I am running into an issue that I just can't seem to find the answer to. I have a Windows Server 2008 box that is running Apache 2.2.14, PHP 5.2.11, and MySQL 5.1.39. My problem is I am trying to call
How would I protect......
I have a from, actually, a good amount of forms. How can I make it so you can't type the characters: '!~*&^%().;-_ in the form? Where it completely blocks those characters
Keep newlines from textarea?..
I'm creating a simple encoding program, and what I want it to do is retain the newlines, as echoing a textarea for example will strip them out (I think). How do I retain the \n's or whatnot and place