PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesPHP Development

Closed Thread
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old December 19th, 2012, 02:09 PM
fraz_pk fraz_pk is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2012
Posts: 7 fraz_pk User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 34 m 9 sec
Reputation Power: 0
PHP-General - Query Variable(s) To Mysql DB Using Php

Hello friends,

I am working on php to improve my web development skills. I have created a web based university system using php and mysql. However, I got stuck in coding multi variables to query mysql using php. The multi variables are placed in mysql_query() with AND operator as shown below.

$query3= mysql_query("SELECT * FROM Student WHERE Student_Name='$xstudent' AND Intake='$xmenu'");

I could be able to query single variable however, face problems with multiple variables. The codes below works but when I query $xboth the output displays three tables showing $query, $query2 and $query3.

I WANT TO DISPLAY ONLY $QUERY3 when passing $xboth.



<?php
include 'Lecture/connection.php';

$xstudent=$_POST['stuname'];
$xmenu=$_POST['drop'];
$xboth= $_POST['stuname'] AND $_POST['drop'];


$query= mysql_query("SELECT * FROM Student WHERE Student_Name='$xstudent'");
$query2= mysql_query("SELECT * FROM Student WHERE Intake='$xmenu'");
$query3= mysql_query("SELECT * FROM Student WHERE Student_Name='$xstudent' AND Intake='$xmenu'");


if($xstudent)
{
$fields_num = mysql_num_fields($query);
// Display table
echo "<table border='1'><tr>";
for($i=0; $i<$fields_num; $i++)
{
$field = mysql_fetch_field($query);
echo "<td>{$field->name}</td>";
}
echo "</tr>\n";

while($row = mysql_fetch_row($query))
{
echo "<tr >";
// $row is array... foreach( .. ) puts every element
// of $row to $cell variable
foreach($row as $cell)
echo "<td width= '30' >$cell</td>";
echo "</tr>\n";
}

}


if($xmenu)
{
$fields_num2 = mysql_num_fields($query2);
// Display table
echo "<table border='1'><tr>";
for($i=0; $i<$fields_num2; $i++)
{
$field2 = mysql_fetch_field($query2);
echo "<td>{$field2->name}</td>";
}
echo "</tr>\n";

while($row2 = mysql_fetch_row($query2))
{
echo "<tr >";
// $row is array... foreach( .. ) puts every element
// of $row to $cell variable
foreach($row2 as $cell2)
echo "<td width= '30' >$cell2</td>";
echo "</tr>\n";
}
}

if($xboth )
{
$fields_num3 = mysql_num_fields($query3);
// Display table
echo "<table border='1'><tr>";
for($i=0; $i<$fields_num3; $i++)
{
$field3 = mysql_fetch_field($query3);
echo "<td>{$field3->name}</td>";
}
echo "</tr>\n";

while($row3 = mysql_fetch_row($query3))
{
echo "<tr >";
// $row is array... foreach( .. ) puts every element
// of $row to $cell variable
foreach($row3 as $cell3)
echo "<td width= '30' >$cell3</td>";
echo "</tr>\n";
}
}


THANKS GUYS

Reply With Quote
  #2  
Old December 19th, 2012, 02:18 PM
ManiacDan's Avatar
ManiacDan ManiacDan is offline
Likely to be eaten by a grue.
Dev Shed God 10th Plane (9500 - 9999 posts)
 
Join Date: Oct 2006
Location: Pennsylvania, USA
Posts: 9,805 ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)  Folding Points: 127430 Folding Title: Super Ultimate Folder - Level 1Folding Points: 127430 Folding Title: Super Ultimate Folder - Level 1Folding Points: 127430 Folding Title: Super Ultimate Folder - Level 1Folding Points: 127430 Folding Title: Super Ultimate Folder - Level 1Folding Points: 127430 Folding Title: Super Ultimate Folder - Level 1Folding Points: 127430 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 2 Months 3 Weeks 17 h 43 m 13 sec
Reputation Power: 6112
So you want the first table to only display if $xstudent and not $xboth? Do that:
if ( $xstudent && !$xboth )

The new user guide has information on how to format your posts, and is a good read for new users.
__________________
HEY! YOU! Read the New User Guide and Forum Rules

"They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin

"The greatest tragedy of this changing society is that people who never knew what it was like before will simply assume that this is the way things are supposed to be." -2600 Magazine, Fall 2002

Think we're being rude? Maybe you asked a bad question or you're a Help Vampire. Trying to argue intelligently? Please read this.

Reply With Quote
  #3  
Old December 19th, 2012, 02:18 PM
gw1500se gw1500se is online now
Contributing User
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Jul 2003
Posts: 2,880 gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level) 
Time spent in forums: 1 Year 2 Weeks 2 Days 3 h 29 m 39 sec
Reputation Power: 581
1) If you are learning, STOP. Do not use the depracated mysql extensions. Switch to PDO.
2) Please enclose your code in [ PHP ] tags (see the sticky at the top of this forum) and use proper indentation.
3) Are $xstudent, $xmenu and $xboth mutually exclusive? You probably want to use elseif rather than just if on the 2nd and 3rd conditional blocks.
__________________
There are 10 kinds of people in the world. Those that understand binary and those that don't.

Reply With Quote
  #4  
Old December 19th, 2012, 02:32 PM
fraz_pk fraz_pk is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2012
Posts: 7 fraz_pk User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 34 m 9 sec
Reputation Power: 0
Quote:
Originally Posted by ManiacDan
So you want the first table to only display if $xstudent and not $xboth? Do that:
if ( $xstudent && !$xboth )

The new user guide has information on how to format your posts, and is a good read for new users.


Noted will read the user guide on formatting the post.

When I pass the variable $xboth, it runs if($xboth) block but it also runs if($xstudent) and if($xmenu) block. How can I execute only if($xboth) block when $xboth variable is passed.

$xboth is basically a variable containing values from two attributes with in the same table (Student_Name and Intake).

Reply With Quote
  #5  
Old December 19th, 2012, 02:37 PM
ManiacDan's Avatar
ManiacDan ManiacDan is offline
Likely to be eaten by a grue.
Dev Shed God 10th Plane (9500 - 9999 posts)
 
Join Date: Oct 2006
Location: Pennsylvania, USA
Posts: 9,805 ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)  Folding Points: 127430 Folding Title: Super Ultimate Folder - Level 1Folding Points: 127430 Folding Title: Super Ultimate Folder - Level 1Folding Points: 127430 Folding Title: Super Ultimate Folder - Level 1Folding Points: 127430 Folding Title: Super Ultimate Folder - Level 1Folding Points: 127430 Folding Title: Super Ultimate Folder - Level 1Folding Points: 127430 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 2 Months 3 Weeks 17 h 43 m 13 sec
Reputation Power: 6112
...I answered your question exactly. Did you not understand what I said? You want to only print the first table if $xstudent but not $xboth. That's the data condition you're looking for. Use that in your IF, just like I wrote it.

Reply With Quote
  #6  
Old December 19th, 2012, 02:54 PM
requinix's Avatar
requinix requinix is offline
Still alive
Click here for more information.
 
Join Date: Mar 2007
Location: Washington, USA
Posts: 12,703 requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)  Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 5 Months 1 Week 4 Days 5 h 39 m 40 sec
Reputation Power: 8969
Send a message via AIM to requinix Send a message via MSN to requinix Send a message via Yahoo to requinix Send a message via Google Talk to requinix
Quote:
Originally Posted by gw1500se
depracated

I'm trying to figure out why you bolded the 'a'...
Comments on this post
gw1500se agrees: Beacuse Jaques1 insists that is what I should use.
ptr2void agrees: Yes, but the a should be an e. It's "deprecated".

Reply With Quote
  #7  
Old December 19th, 2012, 03:02 PM
fraz_pk fraz_pk is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2012
Posts: 7 fraz_pk User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 34 m 9 sec
Reputation Power: 0
Quote:
Originally Posted by ManiacDan
...I answered your question exactly. Did you not understand what I said? You want to only print the first table if $xstudent but not $xboth. That's the data condition you're looking for. Use that in your IF, just like I wrote it.


Thanks big bro for answering. I want to print only the third table if $xboth but not if $xstudent and if $xmenu. Its runs all three $xstudent, $xmenu and $xboth when passing $xboth

I am still learning Cool down bro!!!

Reply With Quote
  #8  
Old December 20th, 2012, 07:19 AM
ManiacDan's Avatar
ManiacDan ManiacDan is offline
Likely to be eaten by a grue.
Dev Shed God 10th Plane (9500 - 9999 posts)
 
Join Date: Oct 2006
Location: Pennsylvania, USA
Posts: 9,805 ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)  Folding Points: 127430 Folding Title: Super Ultimate Folder - Level 1Folding Points: 127430 Folding Title: Super Ultimate Folder - Level 1Folding Points: 127430 Folding Title: Super Ultimate Folder - Level 1Folding Points: 127430 Folding Title: Super Ultimate Folder - Level 1Folding Points: 127430 Folding Title: Super Ultimate Folder - Level 1Folding Points: 127430 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 2 Months 3 Weeks 17 h 43 m 13 sec
Reputation Power: 6112
I'm not worked up or anything, I'm just wondering what the disconnect is.

You solved the problem then I assume.

Reply With Quote
  #9  
Old December 20th, 2012, 08:48 AM
chadsmith729's Avatar
chadsmith729 chadsmith729 is offline
I fail at spelling
Dev Shed Loyal (3000 - 3499 posts)
 
Join Date: Sep 2003
Location: NDAuNjIxMTExLC03OS4xNTU=
Posts: 3,234 chadsmith729 User rank is General 12nd Grade (Above 100000 Reputation Level)chadsmith729 User rank is General 12nd Grade (Above 100000 Reputation Level)chadsmith729 User rank is General 12nd Grade (Above 100000 Reputation Level)chadsmith729 User rank is General 12nd Grade (Above 100000 Reputation Level)chadsmith729 User rank is General 12nd Grade (Above 100000 Reputation Level)chadsmith729 User rank is General 12nd Grade (Above 100000 Reputation Level)chadsmith729 User rank is General 12nd Grade (Above 100000 Reputation Level)chadsmith729 User rank is General 12nd Grade (Above 100000 Reputation Level)chadsmith729 User rank is General 12nd Grade (Above 100000 Reputation Level)chadsmith729 User rank is General 12nd Grade (Above 100000 Reputation Level)chadsmith729 User rank is General 12nd Grade (Above 100000 Reputation Level)chadsmith729 User rank is General 12nd Grade (Above 100000 Reputation Level)chadsmith729 User rank is General 12nd Grade (Above 100000 Reputation Level)chadsmith729 User rank is General 12nd Grade (Above 100000 Reputation Level)chadsmith729 User rank is General 12nd Grade (Above 100000 Reputation Level)chadsmith729 User rank is General 12nd Grade (Above 100000 Reputation Level)  Folding Points: 318638 Folding Title: Super Ultimate Folder - Level 1Folding Points: 318638 Folding Title: Super Ultimate Folder - Level 1Folding Points: 318638 Folding Title: Super Ultimate Folder - Level 1Folding Points: 318638 Folding Title: Super Ultimate Folder - Level 1Folding Points: 318638 Folding Title: Super Ultimate Folder - Level 1Folding Points: 318638 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 1 Month 1 Day 16 h 4 m 38 sec
Reputation Power: 1773
PHP Code:
<?php
include 'Lecture/connection.php';

$xstudent=$_POST['stuname'];
$xmenu=$_POST['drop'];
$xboth$_POST['stuname'] AND $_POST['drop'];


$querymysql_query("SELECT * FROM Student WHERE Student_Name='$xstudent'");
$query2mysql_query("SELECT * FROM Student WHERE Intake='$xmenu'");
$query3mysql_query("SELECT * FROM Student WHERE Student_Name='$xstudent' AND Intake='$xmenu'");


if(
$xstudent)
{
    
$fields_num mysql_num_fields($query);
    
// Display table
    
echo "<table border='1'><tr>";
    for(
$i=0$i<$fields_num$i++)
    {
        
$field mysql_fetch_field($query);
        echo 
"<td>{$field->name}</td>";
    }
    echo 
"</tr>\n";

    while(
$row mysql_fetch_row($query))
    {
        echo 
"<tr >";
        
// $row is array... foreach( .. ) puts every element
        // of $row to $cell variable
        
foreach($row as $cell) {
            echo 
"<td width= '30' >$cell</td>";
            echo 
"</tr>\n";
        }
    }
}


if(
$xmenu)
{
    
$fields_num2 mysql_num_fields($query2);
    
// Display table
    
echo "<table border='1'><tr>";
    for(
$i=0$i<$fields_num2$i++)
    {
        
$field2 mysql_fetch_field($query2);
        echo 
"<td>{$field2->name}</td>";
    }
    echo 
"</tr>\n";

    while(
$row2 mysql_fetch_row($query2))
    {
        echo 
"<tr >";
        
// $row is array... foreach( .. ) puts every element
        // of $row to $cell variable
        
foreach($row2 as $cell2) {
            echo 
"<td width= '30' >$cell2</td>";
            echo 
"</tr>\n";
        }
    }
}

if(
$xboth )
{
    
$fields_num3 mysql_num_fields($query3);
    
// Display table
    
echo "<table border='1'><tr>";
    for(
$i=0$i<$fields_num3$i++)
    {
        
$field3 mysql_fetch_field($query3);
        echo 
"<td>{$field3->name}</td>";
    }
    echo 
"</tr>\n";

    while(
$row3 mysql_fetch_row($query3))
    {
        echo 
"<tr >";
        
// $row is array... foreach( .. ) puts every element
        // of $row to $cell variable
        
foreach($row3 as $cell3) {
            echo 
"<td width= '30' >$cell3</td>";
            echo 
"</tr>\n";
        }
    }
}
?>


Just helping, put braces in your foreach calls that were missing.
__________________
I am working now with Symfony2, Twig, Doctrine, Composer, Assetic, and HTML5. Enjoying doing what I do everyday!

Reply With Quote
  #10  
Old December 26th, 2012, 02:19 AM
fraz_pk fraz_pk is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2012
Posts: 7 fraz_pk User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 34 m 9 sec
Reputation Power: 0
Finally, after weeks of struggle got it working. Thanks ManiacDan, it was data condition and u guided me correctly how ever, instead of if ( $xstudent && !$xboth ) we should use if ( $xstudent && !$xmenu ) and if ( $xmenu && !$xstudent ) and last block will be if ($xboth) to make it work.

Thanks again
really appreciated

Reply With Quote
  #11  
Old December 28th, 2012, 11:11 AM
ManiacDan's Avatar
ManiacDan ManiacDan is offline
Likely to be eaten by a grue.
Dev Shed God 10th Plane (9500 - 9999 posts)
 
Join Date: Oct 2006
Location: Pennsylvania, USA
Posts: 9,805 ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)  Folding Points: 127430 Folding Title: Super Ultimate Folder - Level 1Folding Points: 127430 Folding Title: Super Ultimate Folder - Level 1Folding Points: 127430 Folding Title: Super Ultimate Folder - Level 1Folding Points: 127430 Folding Title: Super Ultimate Folder - Level 1Folding Points: 127430 Folding Title: Super Ultimate Folder - Level 1Folding Points: 127430 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 2 Months 3 Weeks 17 h 43 m 13 sec
Reputation Power: 6112
Both would work fine, unless your variables are the wrong data type.

Reply With Quote
  #12  
Old January 9th, 2013, 02:35 AM
fraz_pk fraz_pk is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2012
Posts: 7 fraz_pk User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 34 m 9 sec
Reputation Power: 0
Quote:
Originally Posted by ManiacDan
Both would work fine, unless your variables are the wrong data type.


all data type used is 'String'

Reply With Quote
  #13  
Old January 9th, 2013, 08:53 AM
ManiacDan's Avatar
ManiacDan ManiacDan is offline
Likely to be eaten by a grue.
Dev Shed God 10th Plane (9500 - 9999 posts)
 
Join Date: Oct 2006
Location: Pennsylvania, USA
Posts: 9,805 ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)  Folding Points: 127430 Folding Title: Super Ultimate Folder - Level 1Folding Points: 127430 Folding Title: Super Ultimate Folder - Level 1Folding Points: 127430 Folding Title: Super Ultimate Folder - Level 1Folding Points: 127430 Folding Title: Super Ultimate Folder - Level 1Folding Points: 127430 Folding Title: Super Ultimate Folder - Level 1Folding Points: 127430 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 2 Months 3 Weeks 17 h 43 m 13 sec
Reputation Power: 6112
Why are they strings? You're using them like booleans.

Reply With Quote
  #14  
Old January 9th, 2013, 11:14 AM
fraz_pk fraz_pk is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2012
Posts: 7 fraz_pk User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 34 m 9 sec
Reputation Power: 0
Quote:
Originally Posted by ManiacDan
Why are they strings? You're using them like booleans.


Not really... all the input values of the variables are string type. I am using data conditioning to query a particular record whose value(s) is derived from multiple flied.

Reply With Quote
  #15  
Old January 9th, 2013, 12:10 PM
ManiacDan's Avatar
ManiacDan ManiacDan is offline
Likely to be eaten by a grue.
Dev Shed God 10th Plane (9500 - 9999 posts)
 
Join Date: Oct 2006
Location: Pennsylvania, USA
Posts: 9,805 ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)  Folding Points: 127430 Folding Title: Super Ultimate Folder - Level 1Folding Points: 127430 Folding Title: Super Ultimate Folder - Level 1Folding Points: 127430 Folding Title: Super Ultimate Folder - Level 1Folding Points: 127430 Folding Title: Super Ultimate Folder - Level 1Folding Points: 127430 Folding Title: Super Ultimate Folder - Level 1Folding Points: 127430 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 2 Months 3 Weeks 17 h 43 m 13 sec
Reputation Power: 6112
PHP Code:
if($xboth 
You are using them like booleans. The inside of an IF must be a true/false expression. PHP will fake it if you do it wrong, but you're still using them like booleans.

Reply With Quote
Closed Thread

Viewing: Dev Shed ForumsProgramming LanguagesPHP Development > PHP-General - Query Variable(s) To Mysql DB Using Php

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap