White_Lily
Members-
Posts
531 -
Joined
-
Last visited
-
Days Won
1
Everything posted by White_Lily
-
I have PM'ed you the link(s) and login details.
-
Right, I managed to find something that has finally worked!! The code that gets the id's that have pages already set: $allRel = select("sidebar_featured_pages", "*"); while($allRelRes = mysql_fetch_array($allRel)){ $usedCats[$allRelRes["category"]] = true; } The code that displays categories that haven't been used: <select name="catSel" style="width: 300px;"> <? $getCategories = select("pages", "id, name", "(page_switch = 1) AND (type = 2 OR type = 4 OR type = 5)"); while ($categories = mysql_fetch_array($getCategories)) { if(!isset($usedCats[$categories['id']])){ echo "<option value='".$categories['id']."'>".$categories['name']."</option>"; } } ?> </select> Thank for the help you all gave! x
-
yeah i have and they have returned the correct values (I checked them against the database). I really can't figure out what's wrong with it.
-
That doesn't solve my issue though - it's still skipping it.
-
How Creat A Square Picture With Two Colors
White_Lily replied to jason213123's topic in PHP Coding Help
I never even knew PFMaBiSmAd's method even existed - that's why I didn't think you could do it with php -
How Creat A Square Picture With Two Colors
White_Lily replied to jason213123's topic in PHP Coding Help
With an image editor. Maaaaaybe CSS... But definitely not php. -
If any jQuery or Javascript came with this stuff, then look there as both jQuery and Javascript can add style classes. Also - try be patient, people have lives.
-
Issue With Submitting Form And Storing In A Mysql Db
White_Lily replied to daveylong's topic in PHP Coding Help
Good. Mark this as solved. -
Issue With Submitting Form And Storing In A Mysql Db
White_Lily replied to daveylong's topic in PHP Coding Help
Also look at the line its specifying to see if you already have that information set. -
Issue With Submitting Form And Storing In A Mysql Db
White_Lily replied to daveylong's topic in PHP Coding Help
Change E_ALL to -1 to show all errors. The warning is the problem btw. I think there is a topic in the PHP Coding category on Header Errors. -
Issue With Submitting Form And Storing In A Mysql Db
White_Lily replied to daveylong's topic in PHP Coding Help
try restarting your web-server -
Issue With Submitting Form And Storing In A Mysql Db
White_Lily replied to daveylong's topic in PHP Coding Help
create a file in your main directory called "php.ini" type in that file: display_errors = on error_reporting = -1 save and refresh your webpage -1 shows every single possible error so that the developer can solve as many problems as he/she can. -
Issue With Submitting Form And Storing In A Mysql Db
White_Lily replied to daveylong's topic in PHP Coding Help
If he is only getting a blank page it would only the main tags in the source such as doctype, html, head, and body. nothing else. -
Basically if the value of say... 10 is in catSel AND category, then I don't want them to be able to have related pages, but if the value isn't equal then they can have related pages. It's like saying if someone registers to a website and they pick a username that has already been taken, then you wouldn't want them to have that username you would want them to pick something different - that's something similar to what i am trying to achieve.
-
Updating Image (With New Image) And Database Details In One Form
White_Lily replied to peakymatt's topic in PHP Coding Help
lol - that code could be cleaned up so much! not just the color tags and the whats with the mass of <tr>'s and <td>'s lol... Ever heard of styling to design the look of a page? -
they are numeric
-
select() is custom function: function select($table, $rows = "*", $where = NULL, $order = NULL, $limit = NULL, $offset = NULL) { $queryString = "SELECT ".$rows." FROM ".$table; if($where != null) $queryString .= " WHERE ".$where; if($order != null) $queryString .= " ORDER BY ".$order; if($limit != null) $queryString .= " LIMIT ".$limit; if($offset != null) $queryString .= " OFFSET ".$offset; $query = mysql_query($queryString); // if query is successful if($query) return $query; else return false; }
-
Hi, I have been asked to sort out a problem with related pages where the CMS lets you add pages even if there some already set. I have written a little validation where it checks if the page selected has already got related pages on it... however the script skips the validation and goes and inserts the new related pages anyway... if(isset($_POST['addTest'])) { // Get posted values $category = mysql_real_escape_string($_POST['catSel']); $product_category = mysql_real_escape_string($_POST['product_category']); $getMultiple = select("sidebar_featured_pages", "*", "category = '$category'"); $check = mysql_fetch_assoc($getMultiple); if($category == $check["catSel"]){ $msg .= generateMsg("Sidebar Pages creation failed, the page you selected already has pages set."); }else{ $addTest = insert("sidebar_featured_pages", array("", $category, $product_category)); if($addTest){ $msg .= generateMsg("Sidebar Pages created successfully.", "success"); }else{ $msg .= generateMsg("Sidebar Pages creation failed, unable to access the database."); } } } Any ideas?
-
Start And End Time Movie/presentation
White_Lily replied to TheDutchBeast's topic in PHP Coding Help
I think he wants it so that the page tells you how long a video lasts from start to finish. A little like YouTube where it has "0:00 - 3:41" or "This video lasts for 3:41 minutes." -
Okay, I want to be able to have people upload an avatar/banner image, it needs to be done so that when they click the file and hit upload, the script takes the file name, seperates it from the file extension, renames the file with a uniqueID, and then adds the file extension back on to give the file its new name, and then move it to a more permanent location on the server... I am basically asking how I go about doing this?
-
lol - um if you want to leave it blank do something like: if(isset($_POST["accessory"])){ //code for if it IS set }elseif(!isset($_POST["accessory"])){ //code ofr when it is NOT set }
-
Add Data To Specific Database Table Column
White_Lily replied to SalientAnimal's topic in PHP Coding Help
^ they will only fill with NULL if his database columns have that box ticked - if not they will just be blank. -
Add Data To Specific Database Table Column
White_Lily replied to SalientAnimal's topic in PHP Coding Help
are you not able to just delete the column? If not try deleting the table and re-creating it without that column? -
Add Data To Specific Database Table Column
White_Lily replied to SalientAnimal's topic in PHP Coding Help
If I'm reading it correctly, try using update rather than insert. Update, updates (obviously) existing entries, whereas insert creates a new row for each entry. Also, since functions such as select, insert, update, delete, etc are very common functions to use in php - can I suggest that you write custom functions for them? Selecting: //Select function select($row = "*", $table, $where = NULL, $order = NULL, $limit = NULL) { $query = "SELECT ".$row." FROM ".$table; if($where != NULL){ $query .= " WHERE ".$where; }if($order != NULL){ $query .= " ORDER BY ".$order; }if($limit != NULL){ $query .= " LIMIT ".$limit; } $result = mysql_query($query); return $result; } Calling the function: $welcome = select("*", "welcome"); $rowWelcome = mysql_fetch_assoc($welcome); echo $rowWelcome["text"];