-
Posts
3,372 -
Joined
-
Last visited
-
Days Won
18
Everything posted by Muddy_Funster
-
Where is your <form> decleration?
-
New to php-function from multiple mysql queries
Muddy_Funster replied to smkncr6's topic in PHP Coding Help
I have no idea what that code is trying to do. If you only want to display the field content where the field type is 1, but still for some reason retrieve a full record set from the database, then you can use an if condition on what to display: while ($row = mysql_fetch_array($result)){ if ($row['Field_Type'] == 1){ echo $row['Field_Content']; } } -
you can't echo an array: echo $info;
-
Your problem is in the css. you have set .profile-general-stats-heading h4{ float: left; font-size: 13px; } because of this you need to add a clear:left or clear:both to your .profile-general-stats table class. : .profile-general-stats table{ width: 98%; clear:left; }
-
echo $row; This won't work. $row is an array of values that represents the row of data retrieved from the database. You would need to address it as an array to echo the contents(echo $row['fieldNameFromDatabase'], or use print_r($row) to pull the raw contents of the array onto the screen.
-
New to php-function from multiple mysql queries
Muddy_Funster replied to smkncr6's topic in PHP Coding Help
Best practice is to propely normalise your data before creating the structure to store it. -
there are several gudes to this already, try searching the forums.
-
On the hosting company front I would recomend 34sp.com There is no way to easily compare dates in 5.2 that I know of, you would need to get/write a function to do it manualy.
-
True, I'm pretty biast though, my issue is when some genius thinks that the best way to get reports from an SQL Server database is to plug access into it, and build a query with all those handy little boxes with all the field names, then run a VB script to export to excell and mail it to people. Then it falls on it's arse, IT finaly get to know about it's existance, and I have to look through the SQL to see what's going on. I'm sure the next office over can hear me swearing every time I come across something stupid like WHERE (((((((([field name with spaces] = ['ask a question']))))) and ((([another field wITH Spaces] >= 1))))))) I meen really, It would have saved everyone time and hastle if I'd just been asked to do it properly from the bloody start. Anyway, I want to go back to my original question to the OP - why are you using a RDBS and at the same time going out your way to avoid the use of relational operators? PS Kickstart, any advance on my sequencing issue?
-
And it's complete inability to pull off optimistic locking - dispite what it says, it's chronicly slow performance, it's price, the fact that it opens database development up to people who realy shouldn't be anywhere near it, it's use of 'custom' SQL that doesn't even match SQL Server. Access is evil, pointless and the source of more problems than the Lybian goverment.
-
@AyKay47 (and I don't meen that I am trying to suppress you ) I appreciate what you are saying, I just have faith that people will keep learning about the new things they are shown @ecabrera it depends on what your notices are. most production servers have notices turned off in the php.ini display_error setting, but some of them can point to potentialy significant problems with your code - perticularly anything that has the word "depreciated" in it.
-
Yip. That's why it came to mind in this post.
-
TBH, it's about the only time I will support it's use. It's when people start suppressing errors I get a bit nervous.
-
use if(@$_POST['addbtn']){ to suppress the notice on the variable existance check. Update your timezone in your php.ini file so that it is set to your servers locatation. There are plenty step by trep guides out there just google if you need one.
-
if($email = "") { echo "you must enter an email address"; } else { you missed out an = in the if. single = assignes the value on the right to the value on the left, double == compaires value on left to value on right. I do it all the time
-
what's the point in using an RDBS if your not going to use relational operators?!? - you'd be as well working in access if that's how your playing it.
-
try not aliasing your table names.
-
Problems with retrieving values sent by a form... HELP ! :D
Muddy_Funster replied to szuwi's topic in PHP Coding Help
Hello and welcome to the forums. First issue can be fixed by changing your query to alias the colum name that is an issue SELECT `Unique Number` as UniqueNumber.... Second issue - look into using htmlentities() on the string retunred from the database. -
You need to have another WHERE outside your SELECT to tell the update which record it is to update, otherwise it will, as you have found out, update every record. ysql_query("UPDATE products t1 SET qty = qty-(SELECT qty FROM pickingLists t2 WHERE t2.productName = t1.productName AND t1.size= t2.size AND t2.listID = '$listID') WHERE table.value = uniqueIdentifier ") or die(mysql_error());
-
It would have done the job, but while loops are generaly used with SQL queries - not sure if there is a real reason for this, but I preffer them because they are easier to follow (for me at least) the logic of and see what you are doing with them.
-
So what are your actual variables? are they single value ($branch), single array per SQL variable ($branch[]) or all stored in a single array? ($insert[branch, address, cost, type])?
-
Yip, it's a little more complicated though: INSERT INTO table ( `branch` ,`address``cost` ,`type` ) VALUES ( CASE WHEN '$branch' = 'A' THEN SELECT 'D' ELSE SELECT '$branch' END,'$address','$cost','$type','' ) Is how I think it would look, but I'm not sure about the use of SELECT...
-
You can't self close an iframe. here's the working code: <style> .idiv {overflow:hidden; width:740px; height:120px;} .idi {overflow:hidden; width:740px; height:120px;} #iframe {width:1000px; height:270px; border:none; margin-left:-120px;margin-top:-130px;} #ifram {width:1000px; height:270px; border:none; margin-left:-120px;margin-top:-130px;} </style> <div class="idiv"> <iframe id="iframe" scrolling="no" frameBorder="0" src="http://itleech.com/index.php"></iframe> </div> <br /> <div class="idi"> <iframe id="ifram" scrolling="no" frameBorder="0" src="http://itleech.com/index.php"></iframe> </div>
-
Why? did you even read the original post?