Meisjen,
the mySQL statement you're looking for is UNION ...
select * from table1 UNION select * from table 2
User Profile
Collapse
-
Abisiva,
This isn't a direct answer to your question, but if you are just starting out learning OOP principles, then I would strongly recommend you save yourself a lot of effort and instead begin with the currently popular approach of using an MVC framework.
I highly recommend you spending some time with CodeIgniter (codeigniter.co m) as I find it quite small and the online tutorials are fairly easy reading.
...Leave a comment:
-
PHPstarter,
This really depends on what you're doing with your logfiles.
There's no point just dumping them into a database as you'll just end up reading them from the database sequentially instead of from the disk.
To go the database route, you need to determine which pieces of information are relevant from the lines in the log file, the split them up and store them in various fields. Doing this allows you...Leave a comment:
-
Yousef, send us a screenshot, and a larger block of your code.
Basically, on your 'comment' links you need to be specifying the id of the post you are commenting on.
Then, in your loop that displays each post, you need to check if the comment id matches the id of the post you are displaying. If so, show the comment form.Leave a comment:
-
David,
The closing curly brace is missing from line 458, just after the $row2[6];
Lol, looks like you found it while I was looking too.Leave a comment:
-
Best way to do this is to learn how to use codeigniter properly.
My less flippant answer: you will need to provide more details and examples of your code before we can offer an answer.Leave a comment:
-
Somewhere, you need to be limiting your SQL to the relevant User ID's which isn't mentioned anywhere in the sql you posted.
First, you are performing an unnecessary SELECT operation which doesn't do anything for you other than retrieve some records from the database, but these don't relate to your UPDATE clause in any way.
Then, you are performing an UPDATE which runs exactly the same command over and over. You probably...Leave a comment:
-
Actually, not knowing the data structures of your tables, you may be able to achieve what you want just by changing the '=' comparison to an 'IN' comparison, like so...
Code:SELECT * FROM teachers WHERE schoolID IN ( SELECT id FROM schools s WHERE s.divisionID IN ( SELECT id FROM division d WHERE d.zoneID IN ( SELECT id FROM zones z WHERE z.zone = 'zone1') ) )
Leave a comment:
-
Mufleeh,
The SQL statement you want is something similar to this...
Code:SELECT * FROM teachers t, schools s, division d, zones z WHERE t.schoolID = s.ID AND s.divisionID = d.ID AND d.zoneID = z.ID AND z.name = 'zone1'
If you use this format, you'll need to change the '*' to a list of the fields that you want returned, otherwise you'll get all fields...Leave a comment:
-
Sid,
You will find that you are only getting the last org_id, not the first one.
The 'mistake' is that you are reading the value of org_id into your $org_key variable, then moving to the next record in your database and again reading the org_id into your $org_key variable - which overwrites the old value that you put in there.
The solution depends on what you are trying to achieve really. From your code, it...Leave a comment:
-
In regards to webshops...
Definitely ZenCart for security - it is taken seriously on the forums.
Magento promotes itself as PCI compliant but only if you pay the $3,000+ for the Professional or Enterprise versions. You won't get much support in the community forums. (http://www.magentocommerce.com/product/compare)
SQL Injection covered well in both these packages. I haven't done any coding with Summercart to...Leave a comment:
-
Dipen,
Check that your web host meets the system requirements for Joomla... http://help.joomla.org/content/view/1938/310/
From the error, the issue is MyISAM. You say that you've installed it in IIS. Check that you've also installed the MySQL database server.Leave a comment:
-
Michael,
I doubt if you're going to find a system to match those requirements.
A1: Look into Zencart, Magento or Summercart.
A2: Define 'easy'? Zencart is 'easy' because it has a huge support base through its forums, but you will need to know how to edit PHP files. Magento is definitely not easy however you look at it, but it is very powerful. Summercart is very pretty and 'easy' to use, but I've not attempted...Leave a comment:
-
Ilya,
Yes, what you posted is correct.
Just to pick up on what NathJ mentioned in his php comment, you are causing a serious issue by doing what you posted. Make sure you read up about 'SQL Injection' which is what you are making possible.
At the very least, you need to ensure that the ID that is given is actually an integer value, eg...
Code:$article = (int)$_GET['id'];
Leave a comment:
-
Michael,
Probably best you take a look at ZenCart (http://www.zen-cart.com/) or a basic eCommerce plugin for WordPress.Leave a comment:
-
Ah, oops, I see the problem with the Operand...
In this line:
$query_Recordse t2 = "SELECT Grade, Topic FROM maths WHERE Subject LIKE (" .$dbfilter. ") ORDER BY Subject ASC";
Change the word LIKE to IN, giving:
$query_Recordse t2 = "SELECT Grade, Topic FROM maths WHERE Subject IN (" .$dbfilter. ") ORDER BY Subject ASC";
Sorry 'bout that.Leave a comment:
-
Ranjit,
" Second, you need to change the 'echo' lines in your html so that they are taking data from the correct dataset. Instead of using echo $row_rsMath you need to change them to echo $row_Recordset2 (because your have created two recordsets in your php code). "
I can see that I missed some replacements in the full code I posted. Just make sure you change all the row_rsMath to row_Recordset2.
...Leave a comment:
-
Ranjit,
there's a few things you need to do to achieve what you want.
First, you need to add value=1 to each of your checkbox <input> tags so that a value is passed when the checkbox is ticked.
Second, you need to change the 'echo' lines in your html so that they are taking data from the correct dataset. Instead of using echo $row_rsMath you need to change them to echo $row_Recordset2 (because your have...Leave a comment:
-
I have just been getting exactly the same problem while reading from an Access database. Wanted to post an answer in case someone finds it useful...
My original code, which showed the same problem as above was:
Code:$conn = new COM('ADODB.Connection') or exit('Cannot start ADO.'); $conn->Open("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=$db"); $rs = $conn->Execute($sql);
Leave a comment:
-
recordset gets messed up by EOF/ reading in it ?
This is a copy of an old post in here, but (presumably because it is so old) I cannot post an answer to, so I am re-creating it....
=============== =============== ==========
Seems like a $rs-> EOF messes up the record set ?
(using php 4.2.2 and MSSQL database)
I try to read the ntext-field "body".
THIS WORKS !!
Code:$dbMail = new COM("ADODB.Connection");
No activity results to display
Show More
Leave a comment: