aebstract
-
Posts
1,105 -
Joined
-
Last visited
Posts posted by aebstract
-
-
You really haven't given us any information on what this "script" is suppose to be doing and what it is doing wrongly. How are we suppose to offer any sort of help?
-
I don't think it would really be a "problem" off the bat, you may run in to security issues or something. I wouldn't recommend anything like that honestly, what is wrong with using post? Might want to take note of this too:
Although the RFC doesn’t lay down any length-related guidelines, Internet Explorer – with its insistence on finding ways to make things difficult for us – enforces a maximum URL length of 2,048 characters.
-
http://php.net/manual/en/function.rand.php
The manual has awesome information, like this post:
<?php // Generate a random character string function rand_str($length = 32, $chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890') { // Length of character list $chars_length = (strlen($chars) - 1); // Start our string $string = $chars{rand(0, $chars_length)}; // Generate random string for ($i = 1; $i < $length; $i = strlen($string)) { // Grab a random character from our list $r = $chars{rand(0, $chars_length)}; // Make sure the same two characters don't appear next to each other if ($r != $string{$i - 1}) $string .= $r; } // Return the string return $string; } ?>
-
oops forgot semi colon
<option <?php if ( $var == $anothervar ) { echo "SELECTED=\"SELECTED\"; } ?> value=\"lalalla.html\">lalalla
<option <?php if ( $var == $anothervar ) { echo "SELECTED"; } ?> value=\"lalalla.html\">lalalla
actually it'd be like that Just needed the basic though, was stupid to not think of it. Thanks!
-
xD Thanks
-
If I have something like: <option value=\"lalalla.html\">lalalla
How can I run a simple if statement in it, roughly like:
<option -if ( $var == $anothervar ) { SELECTED }- value=\"lalalla.html\">lalalla
-
$to = "you@you.com, you@you.com, you@you.com";
This isn't a mysql question.
-
I think he means that he has over 100 rows in his table. Which if that is the case, we still need to know some more information to even help you isolate those results.
-
mysql_query("SELECT * FROM table WHERE user_id = $user_id AND friend = '1'");
-
Was simply my fault for not checking for the last ID again this morning. Everything is good.
-
Okay turned out I had a number wrong, changed it and matched up correctly. Now I get a new error though:
violation of PRIMARY or UNIQUE KEY constraint "INTEG_617" on table "SOITEM"
and with what I'm using you can't use show:
Token unknown - line 1, column 1
SHOW
-
Oh man that's gonna really suck. I'm having to add a line to an order for something and I'm gonna have to track all the foreign keys down to the roots and all in sql. The database tool has a tab showing foreign keys, so I can just go by that but this should take a little while. There's 7 of them for this table, and I bet there's more on the others.
-
Oh, doh.. forgot that line
-
mysql_connect("localhost","2","2"); mysql_select_db("book"); $each="john"; $result= "SELECT * FROM client WHERE client.name LIKE '%".$each."%'"; while($row = mysql_fetch_array($result)) { $sebuty= $row['name']; } echo $sebuty; echo $result; echo $eror;
Need to fetch the information.
http://php.net/manual/en/function.mysql-fetch-array.php
-
violation of FOREIGN KEY constraint "INTEG_618" on table "SOITEM"
Foreign key reference target does not exist
INSERT INTO SOITEM (SOITEM.ID, SOITEM.PRODUCTID, SOITEM.SOID, SOITEM.TYPEID, SOITEM.STATUSID, SOITEM.UOMID, SOITEM.SOLINEITEM, SOITEM.DESCRIPTION, SOITEM.PRODUCTNUM, SOITEM.CUSTOMERPARTNUM, SOITEM.TAXABLEFLAG, SOITEM.QTYTOFULFILL, SOITEM.QTYFULFILLED, SOITEM.QTYPICKED, SOITEM.DATELASTFULFILLMENT, SOITEM.DATESCHEDULEDFULFILLMENT, SOITEM.REVLEVEL, SOITEM.REPAIRFLAG, SOITEM.TBDPRICEFLAG, SOITEM.EXCHANGESOLINEITEM, SOITEM.QBCLASSID, SOITEM.NOTE, SOITEM.SHOWITEMFLAG, SOITEM.ITEMADJUSTID, SOITEM.UNITPRICE, SOITEM.TOTALPRICE, SOITEM.ADJUSTAMOUNT, SOITEM.TOTALCOST) SELECT '1459', '991', SOITEM.SOID, '20', SOITEM.STATUSID, SOITEM.UOMID, '3', 'Restocking Fee', 'Restocking Fee', SOITEM.CUSTOMERPARTNUM, SOITEM.TAXABLEFLAG, SOITEM.QTYTOFULFILL, SOITEM.QTYFULFILLED, SOITEM.QTYPICKED, SOITEM.DATELASTFULFILLMENT, SOITEM.DATESCHEDULEDFULFILLMENT, SOITEM.REVLEVEL, SOITEM.REPAIRFLAG, SOITEM.TBDPRICEFLAG, SOITEM.EXCHANGESOLINEITEM, SOITEM.QBCLASSID, SOITEM.NOTE, SOITEM.SHOWITEMFLAG, SOITEM.ITEMADJUSTID, '29.74', '29.74', SOITEM.ADJUSTAMOUNT, SOITEM.TOTALCOST FROM SOITEM WHERE SOITEM.ID = '116'
Excuse it for being so long and seeming to be a mess, it's only going to be manually ran once and never again. What could be causing this error?
-
Not sure if it will make a difference, but I would try this:
<?php $array=$_POST['imgid']; include('config.site.php'); foreach($array as $key=>$val){ $q = "UPDATE galleries SET order='$val' WHERE id='$key'"; mysql_query($q) or die(mysql_error()); } ?>
-
Yes you can use the ID as the identifier, and since it should be set to auto increment, everyone will have their own unique ID. It's actually how you should identify them. If you make other tables that need to refer to users, you can make a column called userid or something, and refer to that ID.
Your second and third question tie in some php (if that's what you're using)
You're gonna run a query to grab the results on login, which you may have something basic already? Should be similar to this:
$result = mysql_query("SELECT * FROM users WHERE username='username_input' AND password='password_input'"); while($row = mysql_fetch_array($result)) { $userid = $row['ID']; }
This is where I set my sessions, when there is a match, I grab the id and set the session with that. (I use sessions, I'm not sure how you're doing it, just mentioning this)
Third question, what you wanna do is check if it is empty or not and then do something from there. So before your query you run some php tests
if (empty($_POST['username'])){ $username = $username; } else { $username = $_POST['username']; }
Something along those lines, then your "$username" variable is set to either what it previously was, or what they want it changed to. Then run an UPDATE query on all the rows that they have options to change. There are a few ways to do it, this is how I would probably do it.
-
UPDATE is the correct command to do this.
http://dev.mysql.com/doc/refman/5.0/en/update.html
Easier to follow: http://www.w3schools.com/php/php_mysql_update.asp
-
TypesOfFood
ID Name
1 MEAT
2 FRUIT
3 VEGITABLES
AvailableFoods
ID TypeID Name
1 2 Apple
2 2 Orange
3 2 Banana
4 2 Kiwi
5 3 Brocoli
6 3 Carrot
7 1 T-Bone Steak
FoodsInStock
ID Name
1 Apple
2 Apple
3 Banana
4 Banana
5 Banana
6 Banana
SELECT * FROM AvailableFoods LEFT OUTER JOIN FoodsInStockTable ON AvailableFoods.Name = FoodsInStock.Name WHERE AvailableFoods.TypeID = '2' AND FoodsInStock.Name IS NULL
Not sure what you're doing with the null part, but this will do it correctly. If I understand what you're trying to do anyway.
-
I have 4 tables, 2 of the tables I have 1 row of returned information and another I will have 1+ rows and it'll be random.
Part: ID - returns 1 row
Product: partid - returns 1+ rows
Soitem: productnum, productid, soid
SO: ID - returns 1 row
What I need to do is pull some information from soitem where (soitem.soid = so.id) and (product.id = soitem.productid)
The thing is that I pull anywhere from 1 up towards 4 rows from product based on product.partid = part.id. I need to grab the 1 row from soitem where there is a similarity based on the results populated from soitem.soid. I hope this makes sense.
-
I think the answer is going to be more of whatever handles the query after it is ran is what needs to do it. I don't think it's going to be possible in the software I'm using, wish this was php ;(
-
I don't think it will be, but what I got so far is a query to grab a few pieces of information:
SELECT so.dateissued, so.num, soitem.taxableflag, soitem.totalprice, so.shiptoname FROM so JOIN soitem ON so.id = soitem.soid WHERE so.taxrate > '0' AND so.dateissued >= '12-1-09' AND so.dateissued <= '12-31-09' AND billtozip = '95334' ORDER BY so.shiptoname, so.dateissued
What I'm needing to do on the results, is have a total for each unique shiptoname and have it show in the results under each shiptoname's section. For this report there happens to be 3 unique shiptonames and like 50 results. Thing is I can only run 1 query and I don't think I can control the outcome enough to do it
-
Can you get a copy of your log? I wanna see why it crashed.
-
I think in this situation I would set it up somewhat similar to how you have it. I would have 3 tables: artist info, albums, tracks. I'm not sure what you're using "categories" for, but I think it could be used as a column in your albums tables (If I am thinking of this correctly) Inside albums, I would have a column that refers to an artist id and in the tracks I would have a column to reference to an album id. That way you can keep everything tied together. Hope this helps a bit!
Kind of portal system
in PHP Coding Help
Posted
Basically, you don't have anything yet? You'll have a database that holds your user's information. When they are logged in, you display information based on the information you pull from the database. 1 page for all users, it will look correct specific for the user, depending on what information gets pulled from the database.