Recent content by pandemonium7386

  1. P

    Comparing many numbers in PHP?

    I have a data table with 6 numbers (2 x 3 table) and I want to use PHP to find the max number (this is in decimals up to 2 places eg. 41.56). I was thinking about comparing the first two numbers, then getting the largest number from those two and use that to compare it with the 3rd number...
  2. P

    Comparing many numbers in PHP?

    I have a data table with 6 numbers (2 x 3 table) and I want to use PHP to find the max number (this is in decimals up to 2 places eg. 41.56). I was thinking about comparing the first two numbers, then getting the largest number from those two and use that to compare it with the 3rd number...
  3. P

    multiple includes = multiple line breaks (PHP)?

    I have a script that includes about 7 other scripts and it looks like this. <?php require('findSiteTblInfo.php'); require('findCarrierTblInfo.php'); require('findSectorTblInfoiDEN.php'); include("findSectorTblInfoCDMA.php"); include("findJobAssignmentTblInfo.php")...
  4. P

    PHP multiple functions without creating new line?

    <?php function writeName($fname) { echo $fname . " Refsnes.<br />"; } echo "My name is "; writeName("Kai Jim"); echo "My sister's name is "; writeName("Hege"); echo "My brother's name is "; writeName("Stale"); ?> The output is: My name is Kai Jim Refsnes. My sister's name is Hege Refsnes. My...
  5. P

    PHP Fatal error: Call to undefined function getAntModelTblInfo()?

    Can anyone tell me why I keep getting this error, and what I can do to stop it? Also, please note that antModelTbl is related to another table called antVendorTbl in a one-to-one relation (so without a antVendorTbl, there is no antModelTbl). This seems to be the problem, because the...
  6. P

    "Get a data" function (PHP)?

    Here's the code first. $siteQuery = mysql_query("select siteAddress, siteCity, siteState from siteTbl where siteID = $site"); while($info = mysql_fetch_assoc($siteQuery)) { $info['siteAddress']; $info['siteCity']; $info['siteState']; } What is the code for a function that is able to just get...
  7. P

    PHP Table output question?

    I asked this before, but I need more answers. I am trying to output a table using a PHP script. <?php include("dbLogin.php"); mysql_connect(localhost,$username,$password) or die("cannot connect"); mysql_select_db($database) or die("Unable to select database"); $CDMA =...
  8. P

    How to join these in PHP?

    Let's say, I have a table called "Cars" and it looks like this Brand - Color Honda - White Honda - White Honda - Blue What would the mysql code be to make the table look like this (preferably a join command?) Honda - White - NULL Honda - NULL - Blue (Basically, there are two color columns and...
  9. P

    Adding data into table from another table, PHP?

    Hey guys, I'm having trouble adding some data from another table. I have a "sectorTbl" and I tried adding this to the "mainTbl" $query = "INSERT INTO masterTbl VALUES ('','','select siteNum from sectorTbl where secSiteID = "1" and where sector = "1")"; I get an error saying "PHP Parse error...
  10. P

    How to output a table in PHP?

    I have a table named "carsTbl" in mySQL, but how would I output that table in using a PHP script? I have tried this code <?php include("dbLogin.php"); mysql_connect(localhost,$username,$password) or die("cannot connect"); mysql_select_db($database) or die("Unable to select database"); $query...
  11. P

    Why does my PHP code not work?

    In the end, I get an error that says Can't create table './test/employeeTbl.frm' (errno: 150) <?php include("dbLogin.php"); $query="CREATE TABLE employeeTbl( employeeID int(6) NOT NULL primary key auto_increment, emFirstName varchar(30) NOT NULL, emAddress varchar(50) NOT NULL, emCity...
  12. P

    PHP checking POST and new information?

    How would I write a code to see if a new information has been added, and if the post variables didn't post blanks? My primary key is a cuID which is auto incremented everytime it receives new information, so maybe that can be used?
  13. P

    Why do we have to relate tables in PHP?

    My boss was asking me to relate two tables in PHP and from what he explains, it just seems like two non-linked-non-related tables. What is the advantage of relating tables then? Does anyone have a code for this?
Back
Top