-
Posts
840 -
Joined
-
Last visited
-
Days Won
1
Everything posted by gristoi
-
What in particular is not refreshing? Is it php, javascript or css thats causing the issue?
-
add padding or a margin to the list element
-
Just add a style to the ul tag and set the style for the li to #headlines li{ list-style:none;} That will give you no bullet points
-
you can only have it in Descending or Ascending - not both
-
foreach loop - how to not loop witha "," on last loop
gristoi replied to denla's topic in PHP Coding Help
foreach ($interests as $interest) { $query .= "($id, $interest), "; } $query = rtrim($query, ','); -
try wrapping li tags around the anchors <ul id="headlines"> <?php foreach ( $results['articles'] as $article ) { ?> <li><a href=".?action=viewArticle&articleId=<?php echo $article->id?>"><?php echo htmlspecialchars( $article->title )?></a></li> <?php } ?> </ul>
-
Select * from Events WHERE EventType like '%seminar%' AND Date > NOW() ORDER BY Date DESC LIMIT 3
-
try: class test1 { protected $_index; public function __construct($index) { $this->_index = $index; } } class test2 extends test1 { public function output() { echo $this->_index; } }
-
How do I take data from a select query and insert into another table?
gristoi replied to kamlooper's topic in PHP Coding Help
Try doing it in one query with a nested select: INSERT INTO table2 ( value1, value2, value3) VALUES ( SELECT value1, value2, value3 FROM table1 WHERE something = something) -
You need to return a string: return "Web Airlines" You were missing your speech marks
-
Query on several tables - how to do this?
gristoi replied to xwishmasterx's topic in PHP Coding Help
Use the JOIN statement in mysql .: SELECT x.field1, y.field1 from tablex x JOIN tabley y ON x.fieldname = y.fieldname WHERE X.fieldname2 = something -
You will never get a result as $p Dosent equals what is in the database. The password stored looks like a sha1 hash. So you need to hash the password with same encryption: $p =$_POST['upass']; $p = sha1($p); Then search the database.
-
I am gonna pull my EYES OUT!!!! What is wrong here???????
gristoi replied to Bl4ckMaj1k's topic in PHP Coding Help
Try posting the form with the action filled out: < form action ="<?php echo $_SERVER['php_self'] ?> -
If you look at gizmola's last message he advised you that the result returns an associative array. What this means is that the data returned from the server is like this: Array('tmap'=> 1, 'field2'=> something ........... So when you are trying $row=1 you are not accessing what you need from the array. Try if ($row['tmap']==1)
-
You might want to use a switch statement. It has the same effect as elseif, but easier syntax to follow: switch(tmap) { Case 0: echo 'selected 0'; Break; Case 1: echo 'selected 1'; Break; Default: echo 'no tmap selected'; Break; Just remember that you should always use break after each switch statement otherwise the code will continue executing .
-
Without seeing how you have written your code I can only guess that you haven't wrapped your code properly . What you need to do is point your form to a processing page ie: <form action=process.php method="post"> Which will send the form to a process.php page. On this page u can capture the form : If($_POST['Submit']{ // process form then redirect back to a page} please note that this is a very raw example and u shouldn't use $_post['submit'] . But should give the submit button a unique name. ( and well done for researching the issue and giving it a go first )
-
Have you at least attempted to do this yourself? Do you have any tables and a database connection set up. If not then a good place to start is to read up on some basic mysql and php tutorials and at least have a go yourself first. If you have attempted to do this yourself then please post the table structures along with the issues are are having
-
If your using mysql > version 5 you can write a mysql trigger to listen to inputs on the other tables and adjust the value accordingly. Have a read of ; http://dev.mysql.com/doc/refman/5.0/en/triggers.html
-
If you want it to delete all historical records but keep the last 1000 etc then a good option would be to use a mysql trigger. This could listen for each insert / update , check the number of rows and delete all but the newest 1000. ( only if your using mysql >5.1. Have a look at: http://dev.mysql.com/doc/refman/5.0/en/triggers.html
-
SELECT FROM query not returning result for field value >1.99
gristoi replied to RLJ's topic in MySQL Help
If you're working with numerical data then try changing the datatype to float and remove the '' from the values -
Ok, this can be a right pain to get to the bottom of. A few simple things that you can easily overlook. 1. Are you following a namespace convention. Ie your index controller in the base module looks like : Class Base_IndexController extends ....... 2. The names match identically, if foldername is base then class name should start with lowercase b. I know it's really simple stuff, but the easiest problem to solve can sometimes be overlooked. I can't tell you how Many times I have come unstuck because I have accidently added a capital into one of my filenames / class names when I shouldn't off
-
couple of things, I have my modules folder within the application folder, have you added : resources.modules='' resources.frontController.moduleDirectory = APPLICATION_PATH "/modules" into your application.ini. I had the same issue when i started trying to add modules and this sorted it
-
Selecting DATA which is submitted 1 day before(yesterday)
gristoi replied to darubillah's topic in MySQL Help
try: $sql="SELECT * FROM table_name WHERE date(date)=DATE_SUB(CURDATE(), INTERVAL 1 DAY); -
Hi, try moving the starting counts out of the loop <?php $count= $_GET['seatco']; $adult= 0; $child= 0; $concession = 0; for ($i=1; $i<=$count; $i++) { $ticket = $_POST['tick_com'.$i]; echo "tickets: ".$ticket; echo "<br>"; if ($ticket =="adult") { $adult++; } elseif($ticket == "child"){ $child++; } elseif($ticket =="concession"){ $conc++; } else{ echo "no";} } } echo "Adult".$adult; echo "Child".$child; echo "Concession".$conc;
-
As ravenstar said, u can use xampp, once installed a good interface for writing and testing your mysql is mysql workbench