Jump to content

diskhub

Members
  • Posts

    17
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

diskhub's Achievements

Member

Member (2/5)

0

Reputation

  1. Hi following is my code: $conn = ocilogon('scott', 'tiger', 'customers'); $sql = "SELECT * from customers"; $q = ociparse($conn, $sql); $results = ociexecute($q); however, when ever i execute it in PHP5.0, it gives me this error: PHP Warning: ocilogon() [function.ocilogon]: _oci_open_server: ORA-12154: TNS:could not resolve the connect identifier specified in c:\Inetpub\wwwroot\orcl_test.php on line 13 PHP Warning: ociparse(): supplied argument is not a valid OCI8-Connection resource in c:\Inetpub\wwwroot\orcl_test.php on line 16 PHP Warning: ociexecute(): supplied argument is not a valid OCI8-Statement resource in c:\Inetpub\wwwroot\orcl_test.php on line 17
  2. Hi all, i have printed screen my phpMyAdmin relation view. i have to ask how do i make this table's `access_id` to be link with tblaccess table? such that when the next time i wish to INSERT data in phpMyAdmin, i would get a dropdown menu for access_id to be like: 1-NAME i only managed to add the no to it but i really want to see the NAME by it's side. I know this can be done but the NAME field doesn't seem to be displayed at the dropdown menu (FIELD display) on the relation view page. Please help? However, it isn't any problem for me to do the same thing to another column in the same table like the SUPERVISOR entry.
  3. how do you change name of mysql schema / database?
  4. Above is an image which has a design of my database for my 3d animation project. I have given a serial no for an 3d model such as: M01-AB0001-0010 M01 represents modelling category, while animation and other categories could have A02 & O03 eg. AB0001 represents Shot no. of the many scenes such as AB. 0010 represents this is the 10th of the many models for this scene. Right here, i have 3 major sections. Hence, i decided to have 1 table for Modelling, Animation and other main categories 1 table for the various Scenes No. 1 table is for the no of the Model. Is this design practical? or should I just insert the whole of "M01-AB0001-0010" into just one table to make it easier to do a search query? Take note that what i have proposed for the 3 tables above, does not anticipate for the "-" in the serial no. Is it very tough if i were to join the tables up and have to include a "-" into the query? Please guide and help me.
  5. [!--quoteo(post=327336:date=Dec 14 2005, 04:49 PM:name=DanielStead)--][div class=\'quotetop\']QUOTE(DanielStead @ Dec 14 2005, 04:49 PM) 327336[/snapback][/div][div class=\'quotemain\'][!--quotec--] This query works fine SELECT ParcelID, x, y FROM Polygons WHERE Parish = 'Stadhampton' AND ParcelID = 91 AND x BETWEEN 460500 AND 461000 but this query selects multipule ParcelID's when i only want the ones for 91. It seems to be the OR that causes the query not to function as how i thought it would. SELECT ParcelID, x, y FROM Polygons WHERE Parish = 'Stadhampton' AND ParcelID = 91 AND x BETWEEN 460500 AND 461000 OR y BETWEEN 199000 AND 199500 In english i want the query to select PareclID, x and y if parish = stadhampton and ParcelId = 91 and (if (x is between 460500 and 461000) OR (y is between 199000 AND 199500) Can anyone help me with this? Try this daniel: select PareclID, x and y FROM Polygons WHERE ((Parish = 'Stadhampton' AND ParcelID = 91) || ((x BETWEEN 460500 AND 461000)|| (y BETWEEN 199000 AND 199500)))
  6. [!--quoteo(post=327294:date=Dec 14 2005, 01:24 PM:name=ryanlwh)--][div class=\'quotetop\']QUOTE(ryanlwh @ Dec 14 2005, 01:24 PM) 327294[/snapback][/div][div class=\'quotemain\'][!--quotec--] I'm suprised that it didn't generate an error. The "table c" part should be "tablec c" if I'm correct. Change that and see what happens. Also try this: [!--sql--][div class=\'sqltop\']SQL[/div][div class=\'sqlmain\'][!--sql1--][span style=\'color:blue;font-weight:bold\']SELECT[/span] a.***, a.**, b1.b1_name FROM tablea a LEFT JOIN tableb b ON a.b_id = b.b_id LEFT JOIN tableb1 b1 ON b.b1_id = b1.b1_id LEFT JOIN tablec c ON a.c_id= c.c_id ORDER BY a.a_id ASC [!--sql2--][/div][!--sql3--] yes that's my typo. It is tablec c. Nope, it produces no row. Try it if u think it works... it fails badly on me. please help.
  7. no one can help in this? [!--quoteo(post=326990:date=Dec 13 2005, 06:48 PM:name=diskhub)--][div class=\'quotetop\']QUOTE(diskhub @ Dec 13 2005, 06:48 PM) 326990[/snapback][/div][div class=\'quotemain\'][!--quotec--] Above there are 5 tables. I have tried many joins but it didn't work. SELECT a.***, a.**, b1.b1_name FROM tablea a, tableb b, tableb1 b1, table c WHERE (a.b_id = b.b_id AND b.b1_id = b1.b1_id AND a.c_id= c.c_id) ORDER BY a.a_id ASC a.*** and a.** are two other colums of TABLE A. However, it doesn't seem to work. Cos no row is produced. (0 row) But i have double check and all tables have entry well... please help
  8. Above there are 5 tables. I have tried many joins but it didn't work. SELECT a.***, a.**, b1.b1_name FROM tablea a, tableb b, tableb1 b1, table c WHERE (a.b_id = b.b_id AND b.b1_id = b1.b1_id AND a.c_id= c.c_id) ORDER BY a.a_id ASC a.*** and a.** are two other colums of TABLE A. However, it doesn't seem to work. Cos no row is produced. (0 row) But i have double check and all tables have entry well... please help
  9. HI, May i ask how do i insert in between entries of the database table by pushing the entries in the middle portion to the bottom? And do u guys suggestion i do keeping the existing id? or modify the id according to it's entry row?
  10. [!--quoteo(post=325989:date=Dec 10 2005, 02:51 AM:name=obsidian)--][div class=\'quotetop\']QUOTE(obsidian @ Dec 10 2005, 02:51 AM) 325989[/snapback][/div][div class=\'quotemain\'][!--quotec--] exactly. it's much more advisable to use nl2br() when you're displaying the info as opposed to when you insert it to your DB Hey, ok thanks for your help. Just one more question, do i have to store css class as i would like th change the font colour of the words too... And how do this reply page have this good box for replying, how do they implement? They use java? Cos i would like users to highlight certain part of the words and choose the style they want? how do i do that?
  11. [!--quoteo(post=325927:date=Dec 9 2005, 11:38 PM:name=obsidian)--][div class=\'quotetop\']QUOTE(obsidian @ Dec 9 2005, 11:38 PM) 325927[/snapback][/div][div class=\'quotemain\'][!--quotec--] let's say you've just submitted the form, and the $_POST['text'] variable holds your textarea input... just use the nl2br() function, and it will change all the newlines to <br /> tags for you: echo nl2br($_POST['text']); Hi, so does it mean that my database still has to store the <br> in it? Can i keep my database free from "<br>" but yet display it when i draw out the data? Please advise.
  12. Hi, I have been doing a lot of form using php to pass the inputs into mysql database. However, most of the time i have been doing a <br> insertion if i want a break or two in the entry to create a nicer appearance for my text when i were to query it out from mysql. Is this method the right way? Cos i have been thinking that this method really sux alot especially for users who don't know html and when they input something into the textarea, i couldn't expect them to type "<br><br>" into their text. Can anyone tell me how to do this without having to educate users to type in the "<br>" and store them uglily into the database?
  13. diskhub

    phpMyAdmin

    Hi does anyone know what does the [!--coloro:#FF0000--][span style=\"color:#FF0000\"][!--/coloro--]Pack_keys [!--colorc--][/span][!--/colorc--]under Table Option from the operation tab mean? And anyone knows how to auto change the auto_increment back to the smallest after removing an entry without using the Auto_increment under the Table option from the operation tab? Because it is really a pain to remove the entry when i am running some test.
  14. [!--quoteo(post=321486:date=Nov 24 2005, 02:22 AM:name=ryanlwh)--][div class=\'quotetop\']QUOTE(ryanlwh @ Nov 24 2005, 02:22 AM) 321486[/snapback][/div][div class=\'quotemain\'][!--quotec--] echo/print the query. i think $NAME and $EMAIL are null. if those 2 came from a form, make sure you use $_POST['NAME'] or turn register_globals on. Hi they are not null. anyway what's the different between these 3: [!--coloro:#CC0000--][span style=\"color:#CC0000\"][!--/coloro--]$query = "SELECT User_id from gp_users where User_name = '$NAME' and User_email = '$EMAIL'"; $query = "SELECT User_id from gp_users where User_name = '.$NAME.' and User_email = '.$EMAIL.'"; $query = "SELECT User_id from gp_users where (User_name = '$NAME' and User_email = '$EMAIL')";[!--colorc--][/span][!--/colorc--] which one you guys use usually?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.