Why is my row count 0?
Posted on
16th Feb 2014 07:03 pm by
admin
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?
No comments posted yet
Your Answer:
Login to answer
68
44
Other forums
Receive Rosettanet Message to SAP 4.6c
Dear all ,
My customer will send the PO details by rosettanet message , Is it
Table control is disappearing from Screen
Hi Experts,
I have a screen with multiple table control(TC). Each table control has two c
TabControl Inside ListView Not Editing
Hello everybodyI have a ListView on my page. Inside the ListView I put a TabControl, cuz I want to p
Populate drop down list from table??
Lets say for arguments sake that i have a table which contains the numbers 1 to 10.
How can i get
PHP4 to PHP5 Conversion
Hi Everyone,
I am working on a site that is built up on PHP4 and each page is being started f
Sending an SMS Message with ASP.NET
Often times it may be a requirement for your web application to send an SMS message. Such examples w
isset undefined variable
Hi all,
Hope someone can point out the obvious. I've a log in script, if you dont enter a use
how can i make a .gif images for my site
Dear Friends ,
Pls solve my problem , I am starting making new site but i dont know how can i
Why does my crawler script suddenly end with no error?
Hi.
I have written a web crawler script. It will visit a large number of URL's with cURL.
BAPI BBP_INB_DELIVERY_CREATE - material number missing in delivery
Hi Experts,
I was able to successfully create an Inbound delivery with reference to a PO