wildteen88
Staff Alumni-
Posts
10,480 -
Joined
-
Last visited
Never
Everything posted by wildteen88
-
No Idea what PHPList is, I presume it's this. If it is you should read the documentation on how to use it.
-
The keyword self:: is not supported by PHP4.x. It is only available for PHP5. PHP4 has very limited OOP support. You should check the manual to see what PHP4 and PHP5 support.
-
[SOLVED] Displaying results in columns - Part II
wildteen88 replied to Sydcomebak's topic in PHP Coding Help
Not fully tested but try $result = mysql_query("SELECT * FROM FamilyTbl INNER JOIN PeopleTbl ON (FamilyTbl.Name_ID = PeopleTbl.NameID) WHERE FamilyTbl.House_ID = '$address' ORDER BY NameLast, NameFirst ") OR die(mysql_error()); $rows = array(); $num_cols = 3; $j = 1; while($row = mysql_fetch_assoc($rslt)) { $data = $row['NameLast'].', '.$row['NamePrefix'].' '.$row['NameFirst'].' '.$row['NameMiddle'].$row['NameSuffix'].' '; @$rows[$j] .= ' <td>'.$data."</td>\n"; if($j == $num_cols) $j = 0; $j++; } echo "<table>\n"; foreach($rows as $row) { echo " <tr>\n" . $row . " </tr>\n"; } echo '</table>'; -
desc should be asc
-
You're on the right path, you don't the = though it's $sql = "SELECT * FROM stylists ORDER BY id DESC LIMIT 3"; That will return the last three item (oldest)
-
Add ORDER BY column DESC LIMIT at the end of your query
-
isset only checks to see if a variable exists. It does not check to see if the variable has a value
-
$_POST['process_form'] refers to an input field in your form named process_form, not with the value of 'process_form' <input type="submit" value="process_form" /> needs to be
-
You're using the wrong variable, $query holds a string which is your SQL query. You want to compare the $row['SUM(week2-(week2hours*.25))'] variable instead.
-
[SOLVED] I'm losing the MySQL Connection (Link)
wildteen88 replied to DataRater's topic in PHP Coding Help
remove the @ from in front of mysqli and ensure error_reporting is set to E_ALL and display_errors is turn on -
You can also do ALTER TABLE AUTO_INCREMENT=100
-
What are trying to archive? a two column layout of some kind? Have a look at this site and use one of the layouts as a template. This is what I used to do when I started out with CSS layouts.
-
use copy, eg $newname = $_POST['pagename']; copy('path/to/yourfile.ext', 'new/path/'.$newname);
-
Is companyName a variable? If so variables should always start with a dollar sign, eg echo $CompanyName; Again I urge you to read the basics. Getting to know the basics will help you much more than having to keep asking us.
-
No, you dont wrap quotes around variables, only strings. You do know what a string is? I suggest you read the basics of PHP before you continue. Without the basics you're not going to get very far.
-
Help with mysql_fetch_array result and error message
wildteen88 replied to Darkmatter5's topic in PHP Coding Help
Where is the line this variables gets assigned? You might want to echo your query to see how its formatted, eg query="SELECT * FROM byrnjobdb.jobs WHERE job_number = $job"; echo '<pre>' . htmlentities($query) . '</pre>'; $result=mysql_query($query) or die($query . '<br >'.mysql_error()); -
Well this is wrong <body> <?php> echo Impact of Training Form: ?> it should be <body> <?php> echo 'Impact of Training Form:'; ?> All strings must be within quotes.
-
Help with mysql_fetch_array result and error message
wildteen88 replied to Darkmatter5's topic in PHP Coding Help
Judging from what you posted this has nothing to do with the client_list() function. If thats the case where is the $job variable assigned? -
I'm don't have much experience with AJAX, but that code will have to be triggered from an Ajax response, eg when readyState is 4, not within your PHP code. We have an AJAX Help forum here.
-
Help with mysql_fetch_array result and error message
wildteen88 replied to Darkmatter5's topic in PHP Coding Help
I am not understanding your code, is the following <?php include 'library/dbconfig.php'; include 'library/opendb.php'; $query="SELECT * FROM byrnjobdb.jobs WHERE job_number = $job"; $result=mysql_query($query) or die($query . '<br >'.mysql_error()); $row=mysql_fetch_array($result); echo "Job_number: " .$row['job_number']; include 'library/closedb.php'; ?> part of your client_list() function? It would be helpful if you posted the function in full. -
session_start must be called before any output, eg <?php session_start(); ?> .... your html ... <?php // rest of your PHP ?> .. more html It cannot be .... your html ... <?php session_start(); // rest of your PHP ?> .. more html
-
You're trying to call Javascript from within PHP. This is not possible. You'll have output the javascript code, eg echo 'setTimeout( function() { Effect.SlideDown( '.$latest_replies.', { duration: 0.3 } ); });';
-
An example: <?php session_start(); // set our variables, if they are not set we'll set a defaul value. $_SESSION['pageN'] = isset($_SESSION['pageN']) ? $_SESSION['pageN'] : 1; $page = isset($_GET['page']) ? $_GET['page'] : 1; // check to see if the pageN session matches the requested page if($_SESSION['pageN'] == $page) { $_SESSION['pageN']++; echo '<h1>Page' . $page . '</h1>'; } // page does not match, redirect user else { unset($_SESSION['pageN']); header('Location: test.php'); } ?> <a href="?page=1">Page 1</a><br /> <a href="?page=2">Page 2</a><br /> <a href="?page=3">Page 3</a><br /> <a href="?page=4">Page 4</a><br /> Try going to 2, 3 or 4 first and you'll go back to 1.
-
Help with mysql_fetch_array result and error message
wildteen88 replied to Darkmatter5's topic in PHP Coding Help
The way you're doing is the correct to pass parameters to a function/method. Just make sure your client_list method accepts two parameters.