Include/require issue!!!

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
cap2cap10
Forum Contributor
Posts: 158
Joined: Mon Apr 14, 2008 11:06 pm

Include/require issue!!!

Post by cap2cap10 »

Greetings, members of the php technorati. Ok this is a first for me. All I know is that this include/require_once worked one minute and stopped working the next. :banghead: Here is the code:

Code: Select all

<?php
require 'open_db.php';
$prelim_db = mysql_query("SELECT * FROM prelim_db WHERE candidateID = '$candidateID'")
or die(mysql_error());
$row4 = mysql_fetch_array( $prelim_db );
// Database Manager
If ($row4['q_series'] == 1 && $row4['interv'] == "q_db_manag") {
 $p_1 = "<span class=style1>1.  <b>Tell Me About Yourself?</b></span>";
 $p_2 = "<span class=style1>2.  <b>Why should our client hire you?</b></span>";
 $p_3 = "<span class=style1>3.  <b>What are your goals for the next 5 years?</b></span>";
 $p_4 = "<span class=style1>4.  <b>What were your reasons for leaving your last or current Job?</b></span>";
 $p_5 = "<span class=style1>5.  <b>What are Your Strengths and Weaknesses?</b></span>";
 $p_6 = "<span class=style1>6.  <b>What is a Cartesian product? What causes it?</b></span>";
 $p_7 = "<span class=style1>7.  <b>What is an advantage to using a stored procedure as opposed to passing an SQL query from an application.</b></span>";
 $p_8 = "<span class=style1>8.  <b>What is the difference of a LEFT JOIN and an INNER JOIN statement?</b></span>";
 $p_9 = "<span class=style1>9.  <b>When a query is sent to the database and an index is not being used, what type of execution is taking place?</b></span>";
 $p_10 = "<span class=style1>10.  <b>What are the pros and cons of using triggers?</b></span>";
 $p_11 = "<span class=style1>11.  <b>What are the pros and cons of using stored procedures. When would you use them?</b></span>";
 $p_12 = "<span class=style1>12.  <b>What are the pros and cons of using cursors? When would you use them?</b></span>";
 $p_13 = "<span class=style1>13.  <b>How can you determing if an index needs to be dropped and rebuilt?</b></span>";
 $p_14 = "<span class=style1>14.  <b>How would you go about gathering an EXPLAIN plan?</b></span>";
 $p_15 = "<span class=style1>15.  <b>How can you find out how many users are currently logged into the database?How can you find their Operating system ID?</b></span>";
}
elseIf ($row4['q_series'] == 2 && $row4['interv'] == "q_db_manag") {
 $p_1 = "<span class=style1>1.  <b>Tell Me About Yourself?</b></span>";
 $p_2 = "<span class=style1>2.  <b>Why should our client hire you?</b></span>";
 $p_3 = "<span class=style1>3.  <b>What are your goals for the next 5 years?</b></span>";
 $p_4 = "<span class=style1>4.  <b>What were your reasons for leaving your last or current Job?</b></span>";
 $p_5 = "<span class=style1>5.  <b>What are Your Strengths and Weaknesses?</b></span>";
 $p_6 = "<span class=style1>6.  <b>Explain the use of table functions?</b></span>";
 $p_7 = "<span class=style1>7.  <b>Do you consider yourself a development DBA or a prduction DBA and why?</b></span>";
 $p_8 = "<span class=style1>8.  <b>What is the purpose of the IMPORT option IGNORE? What is its default setting?</b></span>";
 $p_9 = "<span class=style1>9.  <b>What happens if a primary key constraint is disabled and then enabled without fully specifying the index clause?</b></span>";
 $p_10 = "<span class=style1>10.  <b>What is difference between open_form and call_form?</b></span>";
 $p_11 = "<span class=style1>11.  <b>What is the advantage of the library?</b></span>";
 $p_12 = "<span class=style1>12.  <b>When do you use data parameter type?</b></span>";
 $p_13 = "<span class=style1>13.  <b>What is a database schema?</b></span>";
 $p_14 = "<span class=style1>14.  <b>Give one method for transferring a table from one schema to another?</b></span>";
 $p_15 = "<span class=style1>15.  <b>What is the use of ANALYZE command?</b></span>";
}
elseIf ($row4['q_series'] == 3 && $row4['interv'] == "q_db_manag") {
 $p_1 = "<span class=style1>1.  <b>Tell Me About Yourself?</b></span>";
 $p_2 = "<span class=style1>2.  <b>Why should our client hire you?</b></span>";
 $p_3 = "<span class=style1>3.  <b>What are your goals for the next 5 years?</b></span>";
 $p_4 = "<span class=style1>4.  <b>What were your reasons for leaving your last or current Job?</b></span>";
 $p_5 = "<span class=style1>5.  <b>What are Your Strengths and Weaknesses?</b></span>";
 $p_6 = "<span class=style1>6.  <b>What is a Database instance?</b></span>";
 $p_7 = "<span class=style1>7.  <b>How can you tell if a database object is invalid?</b></span>";
 $p_8 = "<span class=style1>8.  <b>What are the trigger associated with image items?</b></span>";
 $p_9 = "<span class=style1>9.  <b>What is the difference between a TEMPORARY tablespace and a PERMANENT tablespace?</b></span>";
 $p_10 = "<span class=style1>10.  <b>What is an anchoring object and what is its use?</b></span>";
 $p_11 = "<span class=style1>11.  <b>What is a SNAPSHOT LOG?</b></span>";
 $p_12 = "<span class=style1>12.  <b>What is database clusters?</b></span>";
 $p_13 = "<span class=style1>13.  <b>What is a trace file and how is it created?</b></span>";
 $p_14 = "<span class=style1>14.  <b>What does coalescing a tablespace do?</b></span>";
 $p_15 = "<span class=style1>15.  <b>Why is a Where clause faster than a group filter or a format trigger?</b></span>";
}
if ($row4['q_count'] == 1){
echo $p_1 ;
}
elseif ($row4['q_count'] == 2){
echo $p_2 ;
}
elseif ($row4['q_count'] == 3){
echo $p_3 ;
}
elseif ($row4['q_count'] == 4){
echo $p_4  ;
}
elseif ($row4['q_count'] == 5){
echo $p_5  ;
}
elseif ($row4['q_count'] == 6){
echo $p_6 ;
}
elseif ($row4['q_count'] == 7){
echo $p_7  ;
}
elseif ($row4['q_count'] == 8){
echo $p_8 ;
}
elseif ($row4['q_count'] == 9){
echo $p_9 ;
}
elseif ($row4['q_count'] == 10){
echo $p_10 ;
}
elseif ($row4['q_count'] == 11){
echo $p_11 ;
}
elseif ($row4['q_count'] == 12){
echo $p_12 ;
}
elseif ($row4['q_count'] == 13){
echo $p_13 ;
}
elseif ($row4['q_count'] == 14){
echo $p_14 ;
}
elseif ($row4['q_count'] == 15){
echo $p_15 ;
}
mysql_close();
?>
Please enlighten me as to the error of my ways, because I am clueless right now.
Thanks in advance,

Batoe
User avatar
getmizanur
Forum Commoner
Posts: 71
Joined: Sun Sep 06, 2009 12:28 pm

Re: Include/require issue!!!

Post by getmizanur »

enable php errors to be printed on the screen with ini_set('display_errors', 1)

that should tell you what is going wrong. my guess is that include/require is not finding your php file.
User avatar
cap2cap10
Forum Contributor
Posts: 158
Joined: Mon Apr 14, 2008 11:06 pm

Re: Include/require issue!!!

Post by cap2cap10 »

Ok, the error I am getting is this:

Uncaught SyntaxError: Unexpected token ILLEGAL

??????????????????????????

Batoe
User avatar
Jade
Forum Regular
Posts: 908
Joined: Sun Dec 29, 2002 5:40 pm
Location: VA

Re: Include/require issue!!!

Post by Jade »

You have a syntax error: elseif ($row4['q_count'] == <img src="./images/smilies/icon_cool.gif" alt="8)" title="Cool" />{

Should be: elseif ($row4['q_count'] == "<img src=\"./images/smilies/icon_cool.gif\" alt=\"8)\" title=\"Cool\" />") {
Post Reply